Skip to content

Commit

Permalink
Combine Site Editor list view tests into a single file (#51635)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Jun 19, 2023
1 parent 783bb9c commit a538973
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 49 deletions.
49 changes: 0 additions & 49 deletions test/e2e/specs/site-editor/block-list-panel-preference.spec.js

This file was deleted.

28 changes: 28 additions & 0 deletions test/e2e/specs/site-editor/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,34 @@ test.describe( 'Site Editor List View', () => {
await editor.canvas.click( 'body' );
} );

test( 'should open by default when preference is enabled', async ( {
page,
} ) => {
await expect(
page.locator( 'role=region[name="List View"i]' )
).toBeHidden();

// Turn on block list view by default.
await page.evaluate( () => {
window.wp.data
.dispatch( 'core/preferences' )
.set( 'core/edit-site', 'showListViewByDefault', true );
} );

await page.reload();

await expect(
page.locator( 'role=region[name="List View"i]' )
).toBeVisible();

// The preferences cleanup.
await page.evaluate( () => {
window.wp.data
.dispatch( 'core/preferences' )
.set( 'core/edit-site', 'showListViewByDefault', false );
} );
} );

// If list view sidebar is open and focus is not inside the sidebar, move
// focus to the sidebar when using the shortcut. If focus is inside the
// sidebar, shortcut should close the sidebar.
Expand Down

1 comment on commit a538973

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in a538973.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5309653730
📝 Reported issues:

Please sign in to comment.