mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 21:54:09 +00:00
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user