test: check that hotkeys are focused before use (#55632)

This commit is contained in:
Oliver Eyton-Williams
2024-07-24 16:21:07 +02:00
committed by GitHub
parent f3dc9dd286
commit 25b6fb50a1
2 changed files with 2 additions and 0 deletions
@@ -224,6 +224,7 @@ function Hotkeys({
<> <>
<HotKeys <HotKeys
id='editor-layout' id='editor-layout'
data-playwright-test-label='hotkeys'
allowChanges={true} allowChanges={true}
handlers={handlers} handlers={handlers}
innerRef={containerRef} innerRef={containerRef}
+1
View File
@@ -28,6 +28,7 @@ const openModal = async (page: Page) => {
// The editor pane is focused by default, so we need to escape or it will // The editor pane is focused by default, so we need to escape or it will
// capture the keyboard shortcuts // capture the keyboard shortcuts
await getEditors(page).press('Escape'); await getEditors(page).press('Escape');
await expect(page.getByTestId('hotkeys')).toBeFocused();
await page.keyboard.press('Shift+?'); await page.keyboard.press('Shift+?');
}; };