Skip to content

Commit

Permalink
Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 14, 2022
1 parent f096a08 commit e12ac14
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/e2e-tests/specs/editor/blocks/image.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ describe( 'Image', () => {
`<!-- wp:image {"id":\\d+,"sizeSlug":"full","linkDestination":"none"} -->\\s*<figure class="wp-block-image size-full"><img src="[^"]+\\/${ filename2 }\\.png" alt="" class="wp-image-\\d+"/></figure>\\s*<!-- \\/wp:image -->`
);
expect( await getEditedPostContent() ).toMatch( regex3 );
// For some reason just clicking the block wrapper causes figcaption to get focus
// in puppeteer but not in live browser, so clicking on the image wrapper div here instead.
await page.click( '.wp-block-image > div' );
// Focus outside the block to avoid the image caption being selected
// It can happen on CI specially.
await page.click( '.wp-block-post-title' );
await page.click( '.wp-block-image img' );
await page.keyboard.press( 'Backspace' );

expect( await getEditedPostContent() ).toBe( '' );
Expand Down

0 comments on commit e12ac14

Please sign in to comment.