mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
test: check that hotkeys are focused before use (#55632)
This commit is contained in:
committed by
GitHub
parent
f3dc9dd286
commit
25b6fb50a1
@@ -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}
|
||||||
|
|||||||
@@ -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+?');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user