test(playwright): Notification hygiene — scoped pager locator, next-enabled re-assert, role-mapping-delete doc note

This commit is contained in:
Joseph Doherty
2026-06-07 10:22:54 -04:00
parent d3adf8c2e4
commit 5bc8dbad31
2 changed files with 10 additions and 1 deletions
@@ -571,6 +571,14 @@ public static partial class CliRunner
/// require changing <see cref="BestEffortAsync"/>'s signature or adding an overload. /// require changing <see cref="BestEffortAsync"/>'s signature or adding an overload.
/// The inline try/catch is kept here deliberately — same pattern as /// The inline try/catch is kept here deliberately — same pattern as
/// <see cref="DeleteAreaAsync"/>. /// <see cref="DeleteAreaAsync"/>.
///
/// <para>
/// Maintenance note: this is a three-token CLI group (<c>security role-mapping</c>) so
/// it cannot use the two-token <see cref="BestEffortAsync"/>. If the inline teardown
/// idiom changes (e.g. a new overload of <see cref="BestEffortAsync"/> is added),
/// update all three-token deletes together:
/// <see cref="DeleteAreaAsync"/>, <see cref="DeleteInstanceAlarmOverrideAsync"/>, and this method.
/// </para>
/// </remarks> /// </remarks>
public static async Task DeleteRoleMappingAsync(int id) public static async Task DeleteRoleMappingAsync(int id)
{ {
@@ -415,7 +415,7 @@ public class NotificationActionTests
// placeholder that shares that class renders only while `_notifications == null`. // placeholder that shares that class renders only while `_notifications == null`.
var prev = page.Locator("button.btn-outline-secondary.btn-sm:has-text('Previous')"); var prev = page.Locator("button.btn-outline-secondary.btn-sm:has-text('Previous')");
var next = page.Locator("button.btn-outline-secondary.btn-sm:has-text('Next')"); var next = page.Locator("button.btn-outline-secondary.btn-sm:has-text('Next')");
var indicator = page.Locator("span.text-muted.small"); var indicator = page.Locator(".d-flex.justify-content-between.align-items-center span.text-muted.small");
// ── Page 1 ── (count first — it waits out the fetch — then indicator + buttons). // ── Page 1 ── (count first — it waits out the fetch — then indicator + buttons).
await Assertions.Expect(page.Locator("tbody tr")).ToHaveCountAsync(50, new() { Timeout = 15_000 }); await Assertions.Expect(page.Locator("tbody tr")).ToHaveCountAsync(50, new() { Timeout = 15_000 });
@@ -435,6 +435,7 @@ public class NotificationActionTests
await Assertions.Expect(page.Locator("tbody tr")).ToHaveCountAsync(50, new() { Timeout = 15_000 }); await Assertions.Expect(page.Locator("tbody tr")).ToHaveCountAsync(50, new() { Timeout = 15_000 });
await Assertions.Expect(indicator).ToContainTextAsync("Page 1"); await Assertions.Expect(indicator).ToContainTextAsync("Page 1");
await Assertions.Expect(prev).ToBeDisabledAsync(); await Assertions.Expect(prev).ToBeDisabledAsync();
await Assertions.Expect(next).ToBeEnabledAsync();
} }
finally finally
{ {