test(e2e): tighten API-key validation locator to div.text-danger.small (review precision fix)

This commit is contained in:
Joseph Doherty
2026-06-06 12:10:12 -04:00
parent 89231e3245
commit 73b213442f
@@ -103,7 +103,7 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
await methodCheckbox.CheckAsync();
await page.GetByRole(AriaRole.Button, new() { Name = "Save" }).ClickAsync();
var error = page.Locator("div.text-danger");
var error = page.Locator("div.text-danger.small");
await Assertions.Expect(error).ToBeVisibleAsync(new() { Timeout = 10_000 });
await Assertions.Expect(error).ToContainTextAsync("Name is required.");
@@ -138,7 +138,7 @@ public sealed class ApiKeyCrudTests : IClassFixture<ApiSurfaceFixture>
await page.WaitForLoadStateAsync(LoadState.NetworkIdle);
await page.GetByRole(AriaRole.Button, new() { Name = "Save" }).ClickAsync();
var error = page.Locator("div.text-danger");
var error = page.Locator("div.text-danger.small");
await Assertions.Expect(error).ToBeVisibleAsync(new() { Timeout = 10_000 });
await Assertions.Expect(error).ToContainTextAsync("Select at least one API method for this key.");