Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Nov 28, 2024
1 parent f14552d commit 13cbc45
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions test/e2e/specs/editor/various/write-design-mode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,59 @@ test.describe( 'Write/Design mode', () => {
editorSettings.getByRole( 'button', { name: 'Content' } )
).toBeVisible();
} );

test( 'hides the blocks that cannot be interacted with in List View', async ( {
editor,
page,
pageUtils,
} ) => {
await editor.setContent( '' );

// Insert a section with a nested block and an editable block.
await editor.insertBlock( {
name: 'core/group',
attributes: {},
innerBlocks: [
{
name: 'core/group',
attributes: {
metadata: {
name: 'Non-content block',
},
},
innerBlocks: [
{
name: 'core/paragraph',
attributes: {
content: 'Something',
},
},
],
},
],
} );

// Select the inner paragraph block so that List View is expanded.
await editor.canvas
.getByRole( 'document', {
name: 'Block: Paragraph',
} )
.click();

// Open List View.
await pageUtils.pressKeys( 'access+o' );
const listView = page.getByRole( 'treegrid', {
name: 'Block navigation structure',
} );
const nonContentBlock = listView.getByRole( 'link', {
name: 'Non-content block',
} );

await expect( nonContentBlock ).toBeVisible();

// Switch to write mode.
await editor.switchEditorTool( 'Write' );

await expect( nonContentBlock ).toBeHidden();
} );
} );

0 comments on commit 13cbc45

Please sign in to comment.