Skip to content

Commit

Permalink
Add failing test for plainText paste
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 29, 2023
1 parent b0dda83 commit aac6e44
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/e2e/specs/editor/various/post-title.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,26 @@ test.describe( 'Post title', () => {
'I am <em>emphasis</em> I am <strong>bold</strong> I am <a href="#">anchor</a>'
);
} );

test( 'it should render HTML in plaintext if pasted as plaintext', async ( {
editor,
pageUtils,
} ) => {
const pageTitleField = editor.canvas.getByRole( 'textbox', {
name: 'Add title',
} );

await expect( pageTitleField ).toBeFocused();

pageUtils.setClipboardData( {
plainText:
'I am <em>emphasis</em> I am <strong>bold</strong> I am <a href="#">anchor</a>',
} );
await pageUtils.pressKeys( 'primary+v' );

await expect( pageTitleField ).toHaveText(
'I am <em>emphasis</em> I am <strong>bold</strong> I am <a href="#">anchor</a>'
);
} );
} );
} );

0 comments on commit aac6e44

Please sign in to comment.