fix(centralui): pending-updates rail refreshes as soon as a deployment finishes — cache drops its snapshot on Success/Failed and signals the indicator, instead of serving the pre-deploy count for up to TTL + one poll
This commit is contained in:
@@ -126,6 +126,26 @@ public class PendingUpdatesIndicatorTests : BunitContext
|
||||
return host.FindComponent<PendingUpdatesIndicator>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that the rail re-reads as soon as the cache reports it was invalidated (a
|
||||
/// deployment finished), rather than waiting out its 30 s poll: after a successful Deploy
|
||||
/// all the old count used to linger for up to the cache TTL plus one poll interval.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CacheInvalidated_RereadsWithoutWaitingForThePoll()
|
||||
{
|
||||
var cache = Substitute.For<IPendingUpdatesCache>();
|
||||
cache.GetAsync(Arg.Any<bool>(), Arg.Any<CancellationToken>()).Returns(
|
||||
Task.FromResult(Snapshot(SiteRow(1, staleInstances: 9))),
|
||||
Task.FromResult(Snapshot(SiteRow(1, staleInstances: 0))));
|
||||
var cut = RenderFor(cache, Role(Roles.Deployer));
|
||||
cut.WaitForAssertion(() => Assert.Contains("9 instances", cut.Markup));
|
||||
|
||||
cache.Invalidated += Raise.Event<Action>();
|
||||
|
||||
cut.WaitForAssertion(() => Assert.Contains("Up to date", cut.Markup), TimeSpan.FromSeconds(5));
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a user with only the Viewer role sees no pending-updates indicator.</summary>
|
||||
[Fact]
|
||||
public void Viewer_RendersNothing()
|
||||
|
||||
Reference in New Issue
Block a user