diff --git a/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs b/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs
index 4ec9ee67b67..0026e713176 100644
--- a/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs
+++ b/packages/lexical-playground/__tests__/e2e/CodeBlock.spec.mjs
@@ -980,75 +980,7 @@ test.describe('CodeBlock', () => {
`;
- const EXPECTED_HTML_GOOGLE_SPREADSHEET = html`
-
-
-
-
-
- Surface
-
-
- |
-
-
-
- MWP_WORK_LS_COMPOSER
-
-
- |
-
-
-
- 77349
-
-
- |
-
-
-
-
- Lexical
-
- |
-
-
-
- XDS_RICH_TEXT_AREA
-
-
- |
-
-
- sdvd
-
- sdfvsfs
-
-
- |
-
-
- `;
+
const CODE_PASTING_TESTS = [
{
expectedHTML: EXPECTED_HTML,
@@ -1121,11 +1053,6 @@ test.describe('CodeBlock', () => {
// semantically it should be wrapped in a pre
pastedHTML: `1
2
`,
},
- {
- expectedHTML: EXPECTED_HTML_GOOGLE_SPREADSHEET,
- name: 'Google Spreadsheet',
- pastedHTML: `Surface | MWP_WORK_LS_COMPOSER | 77349 |
Lexical | XDS_RICH_TEXT_AREA | sdvd sdfvsfs |
`,
- },
];
CODE_PASTING_TESTS.forEach((testCase, i) => {
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', () => {
`Hello there | General Kenobi! |
Lexical is nice | ${emptyCell}
`,
);
});
+
+ test('Copy table from an external source like gdoc with formatting', async () => {
+ const {editor} = testEnv;
+
+ const dataTransfer = new DataTransferMock();
+ dataTransfer.setData(
+ 'text/html',
+ 'Surface | MWP_WORK_LS_COMPOSER | 77349 |
Lexical | XDS_RICH_TEXT_AREA | sdvd 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 |
`,
+ );
+ });
});
});