diff --git a/packages/lexical-playground/__tests__/e2e/Hashtags.spec.mjs b/packages/lexical-playground/__tests__/e2e/Hashtags.spec.mjs index b71d479920bc..b3d190dfa19b 100644 --- a/packages/lexical-playground/__tests__/e2e/Hashtags.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/Hashtags.spec.mjs @@ -14,6 +14,7 @@ import { import { assertHTML, assertSelection, + click, focusEditor, html, initialize, @@ -442,7 +443,7 @@ test.describe('Hashtags', () => { ); }); - test('Should not break with multiple matches', async ({ + test('Should not break when pasting multiple matches', async ({ page, isPlainText, }) => { @@ -450,10 +451,33 @@ test.describe('Hashtags', () => { await focusEditor(page); - const clipboard = {'text/html': '#hello#world#more#next#matches'}; + const clipboard = {'text/html': '#hello#world'}; await pasteFromClipboard(page, clipboard); - await waitForSelector(page, '.PlaygroundEditorTheme__hashtag'); + await assertHTML( + page, + html` +

+ + #hello + + #world +

+ `, + ); + }); + + test('Should not break while importing and exporting multiple matches', async ({ + page, + }) => { + await focusEditor(page); + await page.keyboard.type('```markdown #hello#invalid #a #b'); + + await click(page, '.action-button .markdown'); + await click(page, '.action-button .markdown'); + await click(page, '.action-button .markdown'); await assertHTML( page, @@ -464,7 +488,14 @@ test.describe('Hashtags', () => { #hello - #world#more#next#matches + #invalid + + #a + + + + #b +

`, );