From 67c73ec5cc2f1700cecb7479c35d6aa905c986b4 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Fri, 20 Nov 2026 12:27:11 +1100 Subject: [PATCH] test(browser): dismiss the profile notice before closing Settings "Settings loads and publishes the selected community profile" could time out in WebKit clicking Close Settings, with the "Profile updated" notice reported as intercepting pointer events for the whole 10 s. The notice is drawn above dialogs and, at the 1440px test viewport, lands over the centre of Close Settings. The test only waited for the notice to be visible, which is already true while it slides in. Usually the click found the settled notice in the way and waited about 5 s for it to expire. When the click started during the slide, the hit-target check passed, the pointer moved to Close, and the notice settled under it. A pointer resting on a notice holds its expiry, so the notice never left and the click timed out. The test now waits for the notice to settle, hovers it and presses its Dismiss button, as plugin-import.spec already does, then closes Settings. This no longer depends on the notice's timer and removes the 5 s wait. Signed-off-by: Matt Toohey Co-Authored-By: Claude Fable 5.2 --- tests/browser/settings.spec.mjs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/browser/settings.spec.mjs b/tests/browser/settings.spec.mjs index 48df728786..744108165f 100644 --- a/tests/browser/settings.spec.mjs +++ b/tests/browser/settings.spec.mjs @@ -1,3 +1,4 @@ +import { animationsSettled } from "./animations.mjs"; import { setPluginEnabled } from "./plugin-settings.mjs"; import { closeSettings, @@ -1066,10 +1067,19 @@ test("Settings loads and publishes the selected community profile", async ({ }), ).toBeFocused(); await expect(save()).toHaveCount(0); - await expect( - page.getByRole("dialog", { name: "Profile updated" }), - ).toBeVisible(); + const updated = page.getByRole("dialog", { name: "Profile updated" }); + await expect(updated).toBeVisible(); await expect(reopenedName).toHaveValue("Updated community profile"); + // The notice lands over Close Settings, and a pointer resting on it holds + // its expiry. Dismiss it so the click below cannot arrive as it slides in. + const toast = page.locator("[data-sonner-toast]").filter({ has: updated }); + await expect(toast).toHaveAttribute("data-mounted", "true"); + await animationsSettled(toast, { subtree: true }); + await toast.hover(); + await updated + .getByRole("button", { name: "Dismiss notification", exact: true }) + .click(); + await expect(updated).toHaveCount(0); // The account avatar is behind the modal; check it from the workspace. The // pointer left on Close can briefly open a tooltip for the control beneath it. await closeSettings(page);