test(finder): wait for the dialog before keying into it

The close-shortcut test sent its second keystroke as soon as the input
was visible, which is before a dialog with a focus trap has settled.
Waiting for focus instead asserts the same behaviour against a dialog
that is actually ready to receive it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DzALEq9gGWwFmwTdgAiFcY
This commit is contained in:
Claude
2026-08-18 12:42:40 +00:00
parent 2c3ac1b803
commit cd09476858
@@ -238,7 +238,9 @@ test('Close finder with the search shortcut', async ({ page }) => {
await expect(page.getByTestId('panel-rundown')).toBeVisible();
await page.keyboard.press('ControlOrMeta+f');
await expect(page.getByPlaceholder('Search...')).toBeVisible();
// waiting for focus rather than visibility, so the dialog has finished opening
// before the next keystroke is sent
await expect(page.getByPlaceholder('Search...')).toBeFocused();
// the shortcut has to close the finder while the caret is in the search field
await page.getByPlaceholder('Search...').press('ControlOrMeta+f');