Skip to content

Commit

Permalink
Make sure editor canvas button exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Dec 10, 2024
1 parent bc91ba9 commit 344964d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/e2e/specs/site-editor/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ test.describe( 'Site editor navigation', () => {
page.getByRole( 'button', { name: 'Pages' } )
).toBeFocused();

// Navigate to the Saved button first, as it precedes the editor iframe.
await editorNavigationUtils.tabToLabel( 'Saved' );
const savedButton = page.getByRole( 'button', {
name: 'Saved',
} );
await expect( savedButton ).toBeFocused();

// Get the iframe when it has a role=button and Edit label.
const editorCanvasRegion = page.getByRole( 'region', {
name: 'Editor content',
Expand All @@ -60,6 +53,15 @@ test.describe( 'Site editor navigation', () => {
name: 'Edit',
} );

await expect( editorCanvasButton ).toBeVisible();

// Navigate to the Saved button first, as it precedes the editor iframe.
await editorNavigationUtils.tabToLabel( 'Saved' );
const savedButton = page.getByRole( 'button', {
name: 'Saved',
} );
await expect( savedButton ).toBeFocused();

// Test that there are no tab stops between the Saved button and the
// focusable iframe with role=button.
await pageUtils.pressKeys( 'Tab' );
Expand Down

0 comments on commit 344964d

Please sign in to comment.