From d011c3f7471a00dff31f2ce77cb0b51e14cd5570 Mon Sep 17 00:00:00 2001 From: morgmart <98432065+morgmart@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:04:57 -0700 Subject: [PATCH] test(desktop): fix Escape-before-mount race in channel browser e2e (#2101) Co-authored-by: Claude --- desktop/tests/e2e/channel-browser.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop/tests/e2e/channel-browser.spec.ts b/desktop/tests/e2e/channel-browser.spec.ts index c3a71d5a4..20c6d32e2 100644 --- a/desktop/tests/e2e/channel-browser.spec.ts +++ b/desktop/tests/e2e/channel-browser.spec.ts @@ -257,8 +257,16 @@ test("canceling section create does not affect the next global create", async ({ await page .getByTestId(`section-actions-${CUSTOM_SECTION.id}-quick-create`) .click(); + // Gate on the dialog mounting before dismissing it. Escape sent before mount + // is dropped (no handler yet), and not.toBeVisible() then passes vacuously + // against a dialog that hasn't rendered — so the dialog opens *after* the + // assertion and its overlay swallows every later click. + await expect(page.getByTestId("channel-browser-dialog")).toBeVisible(); await page.keyboard.press("Escape"); await expect(page.getByTestId("channel-browser-dialog")).not.toBeVisible(); + // The overlay outlives the content by one exit animation; wait for it to + // detach so it can't intercept the next click. + await expect(page.getByTestId("dialog-overlay")).toHaveCount(0); await page.getByTestId("section-actions-channels-quick-create").click(); const channelName = `global-after-cancel-${Date.now()}`;