Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Dec 8, 2022
1 parent 57943dc commit 21274d5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/e2e/specs/editor/plugins/format-api.spec.js
Expand Up @@ -34,6 +34,28 @@ test.describe( 'Using Format API', () => {
expect( content ).toBe(
`<!-- wp:paragraph -->
<p>First <a href="https://example.com" class="my-plugin-link">paragraph</a></p>
<!-- /wp:paragraph -->`
);
} );

test( 'should show unknow formatting button', async ( {
editor,
page,
} ) => {
await editor.insertBlock( {
name: 'core/paragraph',
attributes: { content: '<big>test</big>' },
} );
expect( await editor.getEditedPostContent() ).toBe(
`<!-- wp:paragraph -->
<p><big>test</big></p>
<!-- /wp:paragraph -->`
);
await page.keyboard.press( 'ArrowRight' );
await editor.clickBlockToolbarButton( 'Clear Unknown Formatting' );
expect( await editor.getEditedPostContent() ).toBe(
`<!-- wp:paragraph -->
<p>test</p>
<!-- /wp:paragraph -->`
);
} );
Expand Down

0 comments on commit 21274d5

Please sign in to comment.