From 55b926d5d1f07af6b8aa4919c2a862f6c457e125 Mon Sep 17 00:00:00 2001 From: umaranis Date: Mon, 17 Apr 2023 23:08:55 +1000 Subject: [PATCH] test: copy and paste testing; add delay for image loading --- .../src/__tests__/e2e/CopyAndPaste.spec.mjs | 25 +++++++++++++++++-- .../src/__tests__/e2e/Images.spec.mjs | 2 ++ .../plugins/link/FloatingLinkEditor.svelte | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/demos/playground/src/__tests__/e2e/CopyAndPaste.spec.mjs b/demos/playground/src/__tests__/e2e/CopyAndPaste.spec.mjs index d75c826..08b3186 100644 --- a/demos/playground/src/__tests__/e2e/CopyAndPaste.spec.mjs +++ b/demos/playground/src/__tests__/e2e/CopyAndPaste.spec.mjs @@ -1501,7 +1501,7 @@ test.describe('CopyAndPaste', () => { }); }); - test.fixme('HTML Copy + paste an anchor element', async ({page, isPlainText}) => { + test('HTML Copy + paste an anchor element', async ({page, isPlainText}) => { test.skip(isPlainText); await focusEditor(page); @@ -1568,7 +1568,7 @@ test.describe('CopyAndPaste', () => { ); }); - test.fixme('HTML Copy + paste a list element', async ({page, isPlainText}) => { + test('HTML Copy + paste a list element', async ({page, isPlainText}) => { test.skip(isPlainText); await focusEditor(page); @@ -1604,6 +1604,27 @@ test.describe('CopyAndPaste', () => { ); }); + test('HTML Copy + paste a Lexical nested list', async ({ + page, + isPlainText, + }) => { + test.skip(isPlainText); + + await focusEditor(page); + + const clipboard = { + 'text/html': + '', + }; + + await pasteFromClipboard(page, clipboard); + + await assertHTML( + page, + '', + ); + }); + test.fixme('HTML Copy + paste (Nested List - directly nested ul)', async ({ page, isPlainText, diff --git a/demos/playground/src/__tests__/e2e/Images.spec.mjs b/demos/playground/src/__tests__/e2e/Images.spec.mjs index cdcfb25..1861462 100644 --- a/demos/playground/src/__tests__/e2e/Images.spec.mjs +++ b/demos/playground/src/__tests__/e2e/Images.spec.mjs @@ -404,6 +404,8 @@ test.describe('Images', () => { 'a pretty yellow flower :)', ); + await page.waitForTimeout(3000); + await assertHTML( page, html` diff --git a/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte b/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte index 4b979b4..c3a17ab 100644 --- a/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte +++ b/packages/svelte-lexical/src/core/plugins/link/FloatingLinkEditor.svelte @@ -174,7 +174,7 @@ {linkUrl} - +