From 92d5699fd20d77af7b5189d63bd1ae40fe6174ea Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Mon, 22 Jul 2024 10:11:50 +0900 Subject: [PATCH] Add e2e test --- ...d-text-into-focusable-element-1-chromium.txt | 3 +++ .../specs/editor/various/copy-cut-paste.spec.js | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-formatted-text-into-focusable-element-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-formatted-text-into-focusable-element-1-chromium.txt b/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-formatted-text-into-focusable-element-1-chromium.txt new file mode 100644 index 00000000000000..176e45e60cb0a4 --- /dev/null +++ b/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-formatted-text-into-focusable-element-1-chromium.txt @@ -0,0 +1,3 @@ + +

testtest

+ \ No newline at end of file diff --git a/test/e2e/specs/editor/various/copy-cut-paste.spec.js b/test/e2e/specs/editor/various/copy-cut-paste.spec.js index 33a65e6f5a1195..e351efdad4a3f0 100644 --- a/test/e2e/specs/editor/various/copy-cut-paste.spec.js +++ b/test/e2e/specs/editor/various/copy-cut-paste.spec.js @@ -478,6 +478,23 @@ test.describe( 'Copy/cut/paste', () => { ).toBe( 'axyb' ); } ); + test( 'should paste formatted text into focusable element', async ( { + page, + pageUtils, + editor, + } ) => { + await editor.canvas + .locator( 'role=button[name="Add default block"i]' ) + .click(); + await page.keyboard.type( 'test' ); + await pageUtils.pressKeys( 'primary+a' ); + await pageUtils.pressKeys( 'primary+b' ); + await pageUtils.pressKeys( 'primary+c' ); + await page.keyboard.press( 'ArrowRight' ); + await pageUtils.pressKeys( 'primary+v' ); + expect( await editor.getEditedPostContent() ).toMatchSnapshot(); + } ); + test( 'should paste preformatted in list', async ( { page, pageUtils,