refactor(ui): unify semantic presentation and table hierarchy
This commit is contained in:
@@ -150,6 +150,26 @@ public class TopologyPageTests : BunitContext
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>Every load state keeps one semantic page title.</summary>
|
||||
[Theory]
|
||||
[InlineData("loading")]
|
||||
[InlineData("loaded")]
|
||||
[InlineData("error")]
|
||||
public async Task PageTitle_RemainsOneH1AcrossLoadStates(string state)
|
||||
{
|
||||
SeedRepos();
|
||||
var pending = new TaskCompletionSource<IReadOnlyList<Site>>(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
if (state == "loading") _siteRepo.GetAllSitesAsync().Returns(pending.Task);
|
||||
if (state == "error") _siteRepo.GetAllSitesAsync().Returns(Task.FromException<IReadOnlyList<Site>>(new Exception("local failure")));
|
||||
var cut = Render<TopologyPage>();
|
||||
try
|
||||
{
|
||||
Assert.Single(cut.FindAll("h1"));
|
||||
Assert.Equal("Topology", cut.Find("h1").TextContent.Trim());
|
||||
}
|
||||
finally { await cut.InvokeAsync(() => pending.TrySetResult([])); }
|
||||
}
|
||||
|
||||
private IRenderedComponent<TopologyPage> RenderLoadedTopology()
|
||||
{
|
||||
var cut = Render<TopologyPage>();
|
||||
|
||||
Reference in New Issue
Block a user