test(e2e): structural modal discriminator + simpler post-delete wait (review fixes)

This commit is contained in:
Joseph Doherty
2026-06-05 10:34:07 -04:00
parent 8e11f1f900
commit 917e5f30bf
@@ -62,7 +62,9 @@ public class TemplateCrudTests
await page.ClickAsync("button.btn.btn-primary.btn-sm:has-text('Add Attribute')");
// The modal is a page-local .modal.show.d-block — NOT the global DialogHost.
var modal = page.Locator(".modal.show.d-block");
// DialogHost adds a `fade` class; the page-local modal does not, so :not(.fade)
// ensures we match only the page-local Add-Attribute modal.
var modal = page.Locator(".modal.show.d-block:not(.fade)");
await Assertions.Expect(modal).ToBeVisibleAsync();
await Assertions.Expect(modal.Locator(".modal-title")).ToHaveTextAsync("Add Attribute");
@@ -92,7 +94,8 @@ public class TemplateCrudTests
await confirmBtn.ClickAsync();
// After delete, Blazor navigates back to /design/templates (the list page).
await PlaywrightFixture.WaitForPathAsync(page, "/design/templates", excludePath: $"/design/templates/{page.Url.Split('/').Last()}");
// excludePath: "/design/templates/" rejects any /design/templates/{id} detail URL.
await PlaywrightFixture.WaitForPathAsync(page, "/design/templates", excludePath: "/design/templates/");
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
// The template name must no longer appear in the tree view.