test(dashboard): settings render test proves label-value pairing
This commit is contained in:
@@ -74,8 +74,9 @@ public sealed class SettingsPageTagVisibilityRenderTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <c>RecentFaultLimit</c> and <c>RecentSessionLimit</c> reach the page. Non-default values
|
/// <c>RecentFaultLimit</c> and <c>RecentSessionLimit</c> reach the page, each value landing in
|
||||||
/// prove the projection is plumbed through, not just that the defaults happen to render.
|
/// 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>
|
/// </summary>
|
||||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -87,10 +88,11 @@ public sealed class SettingsPageTagVisibilityRenderTests
|
|||||||
RecentSessionLimit = 456,
|
RecentSessionLimit = 456,
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.Contains("Recent fault limit", html, StringComparison.Ordinal);
|
// Combined label+value fragments, matching the razor's exact markup (no whitespace between
|
||||||
Assert.Contains("123", html, StringComparison.Ordinal);
|
// tags): a bare Contains on "123"/"456" would pass even if the values landed in the wrong
|
||||||
Assert.Contains("Recent session limit", html, StringComparison.Ordinal);
|
// row, or any other row on the page.
|
||||||
Assert.Contains("456", html, StringComparison.Ordinal);
|
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)
|
private static async Task<string> RenderAsync(DashboardOptions dashboard)
|
||||||
|
|||||||
Reference in New Issue
Block a user