Skip to content

Commit

Permalink
removed snapshots and updated locator of save button
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed May 29, 2023
1 parent 6261b58 commit 2514e49
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 21 additions & 3 deletions test/e2e/specs/editor/blocks/links.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,19 @@ test.describe( 'Links', () => {
await pageUtils.pressKeys( 'primary+k' );
await page.keyboard.type( 'w.org' );

await page.getByRole( 'button', { name: 'Apply' } ).click();
await page
.locator( '.block-editor-link-control' )
.getByRole( 'button', { name: 'Save' } )
.click();

expect( await editor.getEditedPostContent() ).toMatchSnapshot();
await expect.poll( editor.getBlocks ).toMatchObject( [
{
name: 'core/paragraph',
attributes: {
content: 'This is <a href="http://w.org">WordPress</a>',
},
},
] );

// Move caret back into the link.
await page.keyboard.press( 'ArrowLeft' );
Expand All @@ -109,6 +119,14 @@ test.describe( 'Links', () => {
.inputValue();
expect( urlInputValue ).toContain( 'wordpress.org' );

expect( await editor.getEditedPostContent() ).toMatchSnapshot();
await expect.poll( editor.getBlocks ).toMatchObject( [
{
name: 'core/paragraph',
attributes: {
content:
'This is <a href="http://wordpress.org">WordPress</a>',
},
},
] );
} );
} );

0 comments on commit 2514e49

Please sign in to comment.