Validate audit windows and isolate dashboard count reads
This commit is contained in:
@@ -14,6 +14,20 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared;
|
||||
/// </summary>
|
||||
public class ToastNotificationTests : BunitContext
|
||||
{
|
||||
/// <summary>Dismissal names its toast and removes only that notification.</summary>
|
||||
[Fact]
|
||||
public async Task ToastDismiss_HasContextualNameAndPreservesOtherNotification()
|
||||
{
|
||||
var cut = Render<ToastNotification>();
|
||||
await cut.InvokeAsync(() => cut.Instance.ShowError("Save failed", "Configuration", 60000));
|
||||
await cut.InvokeAsync(() => cut.Instance.ShowInfo("Read completed", "Audit query", 60000));
|
||||
var first = cut.FindAll(".toast").First(t => t.TextContent.Contains("Configuration"));
|
||||
Assert.Equal("Dismiss Configuration", first.QuerySelector("button")!.GetAttribute("aria-label"));
|
||||
await cut.InvokeAsync(() => first.QuerySelector("button")!.Click());
|
||||
Assert.Single(cut.FindAll(".toast"));
|
||||
Assert.Contains("Audit query", cut.Markup);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that show toast, when after disposal, is no op and schedules nothing.</summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user