Wait for Accounts drawer focus before testing Enter #89

Merged
eleith merged 1 commits from fix/accounts-drawer-keyboard-journey into main 2026-12-05 00:43:16 +00:00
+3
View File
@@ -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();