Skip to content

Commit 49d856a

Browse files
committed
Add pageUtils dependency and enhance block hiding test for mobile viewport
- Introduced pageUtils to facilitate key presses in the block hiding test. - Added functionality to open List View before switching to mobile preview to maintain block selection when hidden. - Included a comment referencing the related GitHub issue for clarity.
1 parent c910831 commit 49d856a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/e2e/specs/editor/various/block-hiding.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ test.describe( 'Block Hiding', () => {
193193
test( 'should hide a block only on Mobile viewport', async ( {
194194
page,
195195
editor,
196+
pageUtils,
196197
} ) => {
197198
// Insert a paragraph block.
198199
await editor.insertBlock( {
@@ -215,6 +216,13 @@ test.describe( 'Block Hiding', () => {
215216
.getByRole( 'button', { name: 'Apply' } )
216217
.click();
217218

219+
/*
220+
* Open List View so switching device preview does not clear selection for a block
221+
* that becomes hidden in the target viewport (inspector needs a selected block).
222+
* See: https://github.com/WordPress/gutenberg/issues/76275
223+
*/
224+
await pageUtils.pressKeys( 'access+o' );
225+
218226
// Toggle to mobile preview.
219227
await page
220228
.getByRole( 'region', { name: 'Editor top bar' } )

0 commit comments

Comments
 (0)