From b17bba10a24cdde029653c243b9bca9a95f1253b Mon Sep 17 00:00:00 2001 From: eleith Date: Fri, 4 Dec 2026 16:34:55 -0800 Subject: [PATCH] test(web): wait for Accounts drawer focus before activating links --- apps/web/e2e/account-navigation.e2e.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/e2e/account-navigation.e2e.ts b/apps/web/e2e/account-navigation.e2e.ts index 1cff237..9b11001 100644 --- a/apps/web/e2e/account-navigation.e2e.ts +++ b/apps/web/e2e/account-navigation.e2e.ts @@ -177,6 +177,8 @@ test('Accounts drawer preserves focus and client navigation across viewport chan await expect(drawer).not.toBeVisible(); await trigger.click(); await expect(netWorth).toHaveAttribute('aria-current', 'page'); + // Let the dialog finish setting initial focus before moving it to a link. + await expect(close).toBeFocused(); await netWorth.press('Enter'); await expect(drawer).not.toBeVisible(); await expect(main).toBeFocused(); @@ -192,6 +194,7 @@ test('Accounts drawer preserves focus and client navigation across viewport chan await page.setViewportSize({ width: 390, height: 844 }); await trigger.click(); + await expect(close).toBeFocused(); await page.evaluate(() => Object.assign(window, { drawerDocumentRetained: true })); await drawer.getByRole('link', { name: /^Everyday checking\b/ }).press('Enter'); await expect(main.getByRole('heading', { name: 'Everyday checking', exact: true })).toBeVisible(); -- 2.54.1