backend + web: Improve validation and email retry handling
This commit is contained in:
1 parent
e9782a1413
commit
722d318898
13 files changed
+195
-44
No files matched your search
@@ -5,6 +5,7 @@ using System.Net.Http.Json;
|
||||
using Helpdesk.Application.Catalogs;
|
||||
using Helpdesk.Application.Issues;
|
||||
using Helpdesk.Infrastructure.Persistence;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using static Helpdesk.IntegrationTests.BackendFixture;
|
||||
@@ -49,7 +50,8 @@ public sealed class AttachmentTests(BackendFixture fixture) : IClassFixture<Back
|
||||
using var mixed = new MultipartFormDataContent();
|
||||
AddFile(mixed, "spravny.pdf", "%PDF-1.7\n%%EOF"u8.ToArray());
|
||||
AddFile(mixed, "podvrzeny.png", "obsah nemá formát PNG"u8.ToArray());
|
||||
await ExpectAsync(author.PostAsync(path, mixed, Cancellation), HttpStatusCode.BadRequest);
|
||||
var validation = await ReadAsync<ValidationProblemDetails>(author.PostAsync(path, mixed, Cancellation), HttpStatusCode.BadRequest);
|
||||
Assert.Equal("files", Assert.Single(validation.Errors.Keys));
|
||||
|
||||
using var wrongField = new MultipartFormDataContent();
|
||||
wrongField.Add(new ByteArrayContent(png), "image", "zamek.png");
|
||||
|
||||
Reference in new issue
Block a user