Files
Heimdall/tests/Heimdall.Web.Tests/Components/Pages/NotificationsPageTests.cs
T

33 lines
952 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Bunit;
using Bunit.TestDoubles;
using Heimdall.Application.DTOs;
using Heimdall.Web.Components.Pages;
using Shouldly;
namespace Heimdall.Web.Tests.Components.Pages;
public sealed class NotificationsPageTests : PageTestBase
{
[Fact]
public void NotificationsPage_EmptyList_ShowsEmptyState()
{
Handler.OnGet("api/notifications", new PagedResult<NotificationDto>([], 0, 1, 20));
LoginAs();
var cut = RenderPage<NotificationsPage>();
cut.WaitForAssertion(() => cut.Markup.ShouldContain("Vous n’avez aucune notification."));
}
[Fact]
public void NotificationsPage_ApiFailure_ShowsErrorState()
{
Handler.OnGet("api/notifications", System.Net.HttpStatusCode.InternalServerError);
LoginAs();
var cut = RenderPage<NotificationsPage>();
cut.WaitForAssertion(() => cut.Markup.ShouldContain("Impossible de charger les notifications. Réessayez."));
}
}