From bf6448ed57a331c4961c512ec490d1d68f567089 Mon Sep 17 00:00:00 2001 From: wnhlee <2wheeh@gmail.com> Date: Wed, 8 May 2024 22:33:13 +0900 Subject: [PATCH] more test --- .../__tests__/e2e/Hashtags.spec.mjs | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) 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 +

`, );