test(adminui): #1049 NodeEdit/ClusterEdit delete tests wait for the confirm dialog to render before clicking it

This commit is contained in:
Joseph Doherty
2026-12-03 16:25:27 -05:00
parent 7c78a4f456
commit fe4bbbe256
@@ -155,6 +155,8 @@ public sealed class ClusterNodeEditConcurrencySqlServerTests : BunitContext
var cut = Render<NodeEdit>(p => p.Add(x => x.ClusterId, clusterId).Add(x => x.NodeId, nodeId));
cut.WaitForAssertion(() => cut.Find("button.btn-outline-danger"));
cut.Find("button.btn-outline-danger").Click();
// The confirm dialog renders on a later pass than the click: wait for it rather than racing the renderer.
cut.WaitForAssertion(() => cut.Find(".modal-footer .btn-danger"));
cut.Find(".modal-footer .btn-danger").Click();
cut.WaitForAssertion(() =>
@@ -175,6 +177,8 @@ public sealed class ClusterNodeEditConcurrencySqlServerTests : BunitContext
var cut = Render<ClusterEdit>(p => p.Add(x => x.ClusterId, busy));
cut.WaitForAssertion(() => cut.Find("button.btn-outline-danger"));
cut.Find("button.btn-outline-danger").Click();
// The confirm dialog renders on a later pass than the click: wait for it rather than racing the renderer.
cut.WaitForAssertion(() => cut.Find(".modal-footer .btn-danger"));
cut.Find(".modal-footer .btn-danger").Click();
cut.WaitForAssertion(() => cut.Markup.ShouldContain("remove them first"));
@@ -185,6 +189,8 @@ public sealed class ClusterNodeEditConcurrencySqlServerTests : BunitContext
var cut2 = Render<ClusterEdit>(p => p.Add(x => x.ClusterId, empty));
cut2.WaitForAssertion(() => cut2.Find("button.btn-outline-danger"));
cut2.Find("button.btn-outline-danger").Click();
// The confirm dialog renders on a later pass than the click: wait for it rather than racing the renderer.
cut2.WaitForAssertion(() => cut2.Find(".modal-footer .btn-danger"));
cut2.Find(".modal-footer .btn-danger").Click();
cut2.WaitForAssertion(() =>
{