test(overview): migrate renderer fixtures to bUnit 2.7.2

This commit is contained in:
Joseph Doherty
2026-11-13 14:41:17 -05:00
parent f96104245e
commit 8232f3a9ee
20 changed files with 5973 additions and 9 deletions
@@ -9,7 +9,7 @@ namespace ZB.MOM.WW.Overview.Tests;
/// actually distinguish at a glance: which of the four states is shown, whether it is still
/// current, and whether the raw evidence behind it is visible.
/// </summary>
public class InstanceCardTests : TestContext
public class InstanceCardTests : BunitContext
{
private static readonly DateTimeOffset Now = new(2026, 7, 24, 12, 0, 0, TimeSpan.Zero);
@@ -44,7 +44,7 @@ public class InstanceCardTests : TestContext
};
private IRenderedComponent<InstanceCard> Render(InstanceSnapshot instance, bool isLeader = false) =>
RenderComponent<InstanceCard>(p => p
base.Render<InstanceCard>(p => p
.Add(c => c.Instance, instance)
.Add(c => c.Now, Now)
.Add(c => c.IsLeader, isLeader));
@@ -9,7 +9,7 @@ namespace ZB.MOM.WW.Overview.Tests;
/// split-brain warning, and the pause control — which has to freeze the view without pretending
/// the view is still live.
/// </summary>
public class OverviewPageTests : TestContext
public class OverviewPageTests : BunitContext
{
private static readonly DateTimeOffset Now = new(2026, 7, 24, 12, 0, 0, TimeSpan.Zero);
@@ -56,7 +56,7 @@ public class OverviewPageTests : TestContext
}
private IRenderedComponent<Components.Pages.Overview> RenderPage() =>
RenderComponent<Components.Pages.Overview>();
Render<Components.Pages.Overview>();
[Fact]
public void EmptyStore_RendersAnExplicitEmptyState()
@@ -12,11 +12,9 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" />
<PackageReference Include="bunit" Version="1.40.0" />
<!-- Transitive-security pin, test-only: bunit 1.40.0 pulls AngleSharp 1.2.0, which carries
NU1902 (GHSA-pgww-w46g-26qg) and therefore breaks the warnings-as-errors gate. Pinning the
patched version here is the same fix HistorianGateway applied (6bc005d); AngleSharp never
reaches the shipped app, only the bUnit renderer. -->
<PackageReference Include="bunit" Version="2.7.2" />
<!-- Test-only patched parser validated with bUnit 2.7.2 by the shared runtime probe.
This direct reference keeps the parser selection explicit. -->
<PackageReference Include="AngleSharp" Version="1.5.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.7" />
<PackageReference Include="coverlet.collector" Version="6.0.4" />