test(central-ui): cover the per-site KPI error path on the Notification KPIs page
This commit is contained in:
@@ -113,6 +113,24 @@ public class NotificationKpisPageTests : BunitContext
|
||||
cut.WaitForAssertion(() => Assert.Contains("kpi down", cut.Markup));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShowsPerSiteError_WhenPerSiteKpiQueryFails()
|
||||
{
|
||||
// Only the per-site path errors — the global KPI reply stays successful.
|
||||
_perSiteReply = new PerSiteNotificationKpiResponse(
|
||||
"p", false, "per-site down", new List<SiteNotificationKpiSnapshot>());
|
||||
|
||||
var cut = Render<NotificationKpisPage>();
|
||||
|
||||
cut.WaitForAssertion(() =>
|
||||
{
|
||||
Assert.Contains("Per-site KPIs unavailable: per-site down", cut.Markup);
|
||||
// The two error paths are isolated — the global KPI alert (whose markup
|
||||
// opens ">KPIs unavailable:", without the "Per-site " prefix) must not appear.
|
||||
Assert.DoesNotContain(">KPIs unavailable:", cut.Markup);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ShowsPerSiteEmptyState_WhenNoSites()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user