From 52519f831b28dac9ee76de56c859643db547c745 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Fri, 16 Jun 2023 19:48:19 +0400 Subject: [PATCH] Fix the flaky site editor list view tests --- .../specs/site-editor/block-list-panel-preference.spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/e2e/specs/site-editor/block-list-panel-preference.spec.js b/test/e2e/specs/site-editor/block-list-panel-preference.spec.js index d933714017977..7a6e83d09cf7c 100644 --- a/test/e2e/specs/site-editor/block-list-panel-preference.spec.js +++ b/test/e2e/specs/site-editor/block-list-panel-preference.spec.js @@ -38,5 +38,12 @@ test.describe( 'Block list view', () => { 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 ); + } ); } ); } );