test(playwright): drop inert defensive teardown in Sites dup-identifier test (review fix)

This commit is contained in:
Joseph Doherty
2026-06-07 03:43:49 -04:00
parent 64222cf596
commit 3e57c6b054
@@ -215,8 +215,6 @@ public class SiteCrudTests
var page = await _fixture.NewAuthenticatedPageAsync(); var page = await _fixture.NewAuthenticatedPageAsync();
try
{
await page.GotoAsync($"{PlaywrightFixture.BaseUrl}/admin/sites/create"); await page.GotoAsync($"{PlaywrightFixture.BaseUrl}/admin/sites/create");
await page.WaitForLoadStateAsync(LoadState.NetworkIdle); await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
@@ -231,20 +229,10 @@ public class SiteCrudTests
await Expect(page.Locator("div.text-danger.small.mt-2")).ToContainTextAsync("Save failed"); await Expect(page.Locator("div.text-danger.small.mt-2")).ToContainTextAsync("Save failed");
await Assertions.Expect(page) await Assertions.Expect(page)
.ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/admin/sites/create")); .ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/admin/sites/create"));
}
finally // No teardown: the SiteIdentifier unique index guarantees the create persisted nothing.
{ // A spuriously-persisted row would carry identifier "site-a" (not distinctName), and that
// Defensive: the failed create persists nothing, but if a stray site by the // cannot be auto-deleted without destroying the real seed — so there is nothing safe to sweep.
// distinct name somehow exists, best-effort delete it (swallow not-found).
try
{
await CliRunner.DeleteSiteAsync(await CliRunner.ResolveSiteIdAsync(distinctName));
}
catch
{
// Nothing persisted (expected) or cluster unreachable — ignore.
}
}
} }
/// <summary> /// <summary>