Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Sep 20, 2023
1 parent 5175627 commit 22f6851
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 2 additions & 5 deletions test/e2e/specs/editor/various/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,9 @@ test.describe( 'List View', () => {
// the sidebar.
await pageUtils.pressKeys( 'access+o' );

// Focus should now be on the paragraph block since that is
// where we opened the list view sidebar. This is not a perfect
// solution, but current functionality prevents a better way at
// the moment.
// Focus should now be on the list view toggle button.
await expect(
editor.canvas.getByRole( 'document', { name: 'Paragraph block' } )
page.getByRole( 'button', { name: 'Document Overview' } )
).toBeFocused();

// List View should be closed.
Expand Down
13 changes: 7 additions & 6 deletions test/e2e/specs/site-editor/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ test.describe( 'Site Editor List View', () => {
await pageUtils.pressKeys( 'access+o' );
await expect( listView ).not.toBeVisible();

// Focus should now be on the Open Navigation button since that is
// where we opened the list view sidebar. This is not a perfect
// solution, but current functionality prevents a better way at
// the moment.
await expect( openNavigationButton ).toBeFocused();
// Focus should now be on the list view toggle button.
await expect(
page.getByRole( 'button', { name: 'List View' } )
).toBeFocused();

// Open List View.
await pageUtils.pressKeys( 'access+o' );
Expand All @@ -131,6 +130,8 @@ test.describe( 'Site Editor List View', () => {
).toBeFocused();
await pageUtils.pressKeys( 'access+o' );
await expect( listView ).not.toBeVisible();
await expect( openNavigationButton ).toBeFocused();
await expect(
page.getByRole( 'button', { name: 'List View' } )
).toBeFocused();
} );
} );

0 comments on commit 22f6851

Please sign in to comment.