Skip to content

Commit

Permalink
Focussing on the cover block before testing the expand element.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Feb 20, 2022
1 parent 874a457 commit 33cf482
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/e2e-tests/specs/editor/various/list-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ describe( 'List view', () => {
// Check that we're collapsed
expect( await getBlockListLeafNodes() ).toHaveLength( 1 );

// Focus the cover block. The paragraph is not focussed by default.
const coverBlock = await page.waitForSelector( '.wp-block-cover' );

await coverBlock.focus();

// Click the cover title placeholder.
const coverTitle = await page.waitForSelector(
'.wp-block-cover .wp-block-paragraph'
Expand All @@ -138,7 +143,7 @@ describe( 'List view', () => {

// The block list should contain two leafs and the second should be selected (and be a paragraph).
const selectedElementText = await page.$eval(
'.block-editor-list-view-leaf:nth-child(2).is-selected a',
'.block-editor-list-view-leaf.is-selected .block-editor-list-view-block-contents',
( element ) => element.innerText
);

Expand Down

0 comments on commit 33cf482

Please sign in to comment.