test(dashboard): settings render test proves label-value pairing
ci / nightly-windev (push) Has been skipped
ci / windows-x86 (push) Successful in 1m30s
ci / java (push) Successful in 3m3s
ci / portable (push) Successful in 12m36s

This commit is contained in:
Joseph Doherty
2026-08-18 07:25:57 -04:00
parent 8ae0c2f3d3
commit fb68bdb699
@@ -74,8 +74,9 @@ public sealed class SettingsPageTagVisibilityRenderTests
}
/// <summary>
/// <c>RecentFaultLimit</c> and <c>RecentSessionLimit</c> reach the page. Non-default values
/// prove the projection is plumbed through, not just that the defaults happen to render.
/// <c>RecentFaultLimit</c> and <c>RecentSessionLimit</c> reach the page, each value landing in
/// the row its own label names — not merely present somewhere in the document. Non-default
/// values prove the projection is plumbed through, not just that the defaults happen to render.
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
@@ -87,10 +88,11 @@ public sealed class SettingsPageTagVisibilityRenderTests
RecentSessionLimit = 456,
});
Assert.Contains("Recent fault limit", html, StringComparison.Ordinal);
Assert.Contains("123", html, StringComparison.Ordinal);
Assert.Contains("Recent session limit", html, StringComparison.Ordinal);
Assert.Contains("456", html, StringComparison.Ordinal);
// Combined label+value fragments, matching the razor's exact markup (no whitespace between
// tags): a bare Contains on "123"/"456" would pass even if the values landed in the wrong
// row, or any other row on the page.
Assert.Contains("""<th scope="row">Recent fault limit</th><td>123</td>""", html, StringComparison.Ordinal);
Assert.Contains("""<th scope="row">Recent session limit</th><td>456</td>""", html, StringComparison.Ordinal);
}
private static async Task<string> RenderAsync(DashboardOptions dashboard)