From 92a26b33c7817acac9adfe9d2d1c165f6c62d88b Mon Sep 17 00:00:00 2001 From: Ella Date: Wed, 4 Oct 2023 18:43:28 +0300 Subject: [PATCH] Fix list/pre test --- .../src/components/writing-flow/use-clipboard-handler.js | 2 +- test/e2e/specs/editor/various/copy-cut-paste.spec.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/writing-flow/use-clipboard-handler.js b/packages/block-editor/src/components/writing-flow/use-clipboard-handler.js index 15c58866fd14c..1fd8b0de72011 100644 --- a/packages/block-editor/src/components/writing-flow/use-clipboard-handler.js +++ b/packages/block-editor/src/components/writing-flow/use-clipboard-handler.js @@ -155,7 +155,7 @@ export default function useClipboardHandler() { const isInternal = event.clipboardData.getData( 'rich-text' ) === 'true' || // All uses of __unstablePastePlainText use pre. - activeElement.closest( 'pre' ); + !! activeElement.closest( 'pre' ); if ( isInternal ) { return; } 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 823926c1121a0..99ed8bf6d4e84 100644 --- a/test/e2e/specs/editor/various/copy-cut-paste.spec.js +++ b/test/e2e/specs/editor/various/copy-cut-paste.spec.js @@ -453,6 +453,7 @@ test.describe( 'Copy/cut/paste', () => { } ) => { pageUtils.setClipboardData( { html: '
x
', + plainText: 'x', } ); await editor.insertBlock( { name: 'core/list' } ); await pageUtils.pressKeys( 'primary+v' );