diff --git a/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/LinksHTMLCopyAndPaste.spec.mjs b/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/LinksHTMLCopyAndPaste.spec.mjs index a53ae3d6a55..8179af57cb4 100644 --- a/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/LinksHTMLCopyAndPaste.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/CopyAndPaste/html/LinksHTMLCopyAndPaste.spec.mjs @@ -21,9 +21,11 @@ import { assertSelection, click, copyToClipboard, + expect, focusEditor, html, initialize, + locate, pasteFromClipboard, test, } from '../../../utils/index.mjs'; @@ -77,6 +79,7 @@ test.describe('HTML Links CopyAndPaste', () => { ); await click(page, '.link'); + await expect(locate(page, '.link-input')).toBeFocused(); await page.keyboard.type('facebook.com'); await click(page, '.link-confirm'); diff --git a/packages/lexical-playground/__tests__/e2e/Toolbar.spec.mjs b/packages/lexical-playground/__tests__/e2e/Toolbar.spec.mjs index 637b4a8ba30..134672ff3c8 100644 --- a/packages/lexical-playground/__tests__/e2e/Toolbar.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/Toolbar.spec.mjs @@ -40,6 +40,28 @@ test.describe('Toolbar', () => { // Add caption await insertSampleImage(page); + // Catch flakiness earlier + await assertHTML( + page, + html` +

+ +

+ Yellow flower in tilt shift lens +
+ +
+

+ `, + undefined, + { + ignoreClasses: true, + ignoreInlineStyles: true, + }, + ); await click(page, '.editor-image img'); await click(page, '.image-caption-button'); await focus(page, '.ImageNode__contentEditable'); diff --git a/packages/lexical-playground/__tests__/utils/index.mjs b/packages/lexical-playground/__tests__/utils/index.mjs index 213f7b18508..f5f21a28bdf 100644 --- a/packages/lexical-playground/__tests__/utils/index.mjs +++ b/packages/lexical-playground/__tests__/utils/index.mjs @@ -120,6 +120,13 @@ async function exposeLexicalEditor(page) { ).toBeVisible(); }), ); + // Ensure that they started up with the correct empty state + await assertHTML( + page, + html` +


+ `, + ); } const leftFrame = getPageOrFrame(page); await leftFrame.waitForSelector('.tree-view-output pre');