test(dashboard): settings render test proves label-value pairing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user