diff --git a/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs b/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs index dc6b4716a6d..4669a624172 100644 --- a/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs @@ -876,6 +876,7 @@ test.describe('CodeBlock', () => { await assertHTML(page, bcaHTML); }); + test('When pressing CMD/Ctrl + Left, CMD/Ctrl + Right, the cursor should go to the start of the code', async ({ page, isPlainText, diff --git a/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.ts b/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.ts index 694d90e443b..4eb836f0d22 100644 --- a/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.ts +++ b/packages/lexical-table/src/__tests__/unit/LexicalTableNode.test.ts @@ -82,5 +82,23 @@ describe('LexicalTableNode tests', () => { `${emptyCell}

Hello there

General Kenobi!

Lexical is nice

`, ); }); + + test('Copy table from an external source like gdoc with formatting', async () => { + const {editor} = testEnv; + + const dataTransfer = new DataTransferMock(); + dataTransfer.setData( + 'text/html', + '
SurfaceMWP_WORK_LS_COMPOSER77349
LexicalXDS_RICH_TEXT_AREAsdvd sdfvsfs
', + ); + await editor.update(() => { + const selection = $getSelection(); + invariant($isRangeSelection(selection), 'isRangeSelection(selection)'); + $insertDataTransferForRichText(dataTransfer, selection, editor); + }); + expect(testEnv.innerHTML).toBe( + `

Surface

MWP_WORK_LS_COMPOSER

77349

Lexical

XDS_RICH_TEXT_AREA

sdvd sdfvsfs

`, + ); + }); }); });