Skip to content

Commit 18efcda

Browse files
committed
Tests: Use keyboard activation for the menu location checkbox.
Focus the primary menu location checkbox and activate it with Space to avoid a click being lost when focus scrolls the menu screen. Assert the checked state before saving, retaining the saved-location and front-end navigation checks. Follow-up to [65063]. The underlying pointer-interaction issue remains tracked in #65684. Developed in: #15261 Props westonruter. See #54892, #65684. git-svn-id: https://develop.svn.wordpress.org/trunk@65077 602fd350-edb4-49c9-b593-d223f7449a82
1 parent eb9d233 commit 18efcda

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎tests/e2e/specs/classic-menus.test.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ test.describe( 'Classic Menus', () => {
5757
).toBeVisible();
5858

5959
// Assign the menu to the theme's primary location and save.
60-
await page.getByRole( 'checkbox', { name: 'Primary menu' } ).check();
60+
const primaryMenu = page.getByRole( 'checkbox', {
61+
name: 'Primary menu',
62+
} );
63+
// Use the keyboard to avoid the focus-induced scroll described in #65684.
64+
await primaryMenu.focus();
65+
await page.keyboard.press( 'Space' );
66+
await expect( primaryMenu ).toBeChecked();
6167

6268
// Activate via keyboard: the sticky footer bar can shift on focus
6369
// and swallow the first pointer click at certain window heights.

0 commit comments

Comments
 (0)