From 25b6fb50a1d451a28954650595aa1ff07e262f7c Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 24 Jul 2024 16:21:07 +0200 Subject: [PATCH] test: check that hotkeys are focused before use (#55632) --- client/src/templates/Challenges/components/hotkeys.tsx | 1 + e2e/shortcuts-modal.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/client/src/templates/Challenges/components/hotkeys.tsx b/client/src/templates/Challenges/components/hotkeys.tsx index 5efa8444d94..aba3b7217aa 100644 --- a/client/src/templates/Challenges/components/hotkeys.tsx +++ b/client/src/templates/Challenges/components/hotkeys.tsx @@ -224,6 +224,7 @@ function Hotkeys({ <> { // The editor pane is focused by default, so we need to escape or it will // capture the keyboard shortcuts await getEditors(page).press('Escape'); + await expect(page.getByTestId('hotkeys')).toBeFocused(); await page.keyboard.press('Shift+?'); };