Fixes issue with not showing validation errors in the dialogs when creating content and saving/publishing when the names haven't been filled out, adds unit tests to support.

This commit is contained in:
Shannon
2018-09-06 20:33:32 +10:00
parent 20c0185ddf
commit 729177ffef
9 changed files with 142 additions and 22 deletions

View File

@@ -58,14 +58,14 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting
var response = await server.HttpClient.SendAsync(request);
Console.WriteLine(response);
var json = "";
if (response.IsSuccessStatusCode == false)
{
WriteResponseError(response);
}
else
var json = (await ((StreamContent)response.Content).ReadAsStringAsync()).TrimStart(AngularJsonMediaTypeFormatter.XsrfPrefix);
if (!json.IsNullOrWhiteSpace())
{
json = (await ((StreamContent) response.Content).ReadAsStringAsync()).TrimStart(AngularJsonMediaTypeFormatter.XsrfPrefix);
var deserialized = JsonConvert.DeserializeObject(json);
Console.Write(JsonConvert.SerializeObject(deserialized, Formatting.Indented));
}