Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
2wheeh committed May 8, 2024
1 parent 4e14a94 commit 7146506
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/lexical-playground/__tests__/e2e/Hashtags.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
focusEditor,
html,
initialize,
pasteFromClipboard,
pressToggleBold,
repeat,
test,
Expand Down Expand Up @@ -440,4 +441,27 @@ test.describe('Hashtags', () => {
`,
);
});

test('Should not break with multiple matches', async ({page}) => {
await focusEditor(page);

const clipboard = {'text/html': '#hello#world#more#next#matches'};
await pasteFromClipboard(page, clipboard);

await waitForSelector(page, '.PlaygroundEditorTheme__hashtag');

await assertHTML(
page,
html`
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span class="PlaygroundEditorTheme__hashtag" data-lexical-text="true">
#hello
</span>
<span data-lexical-text="true">#world#more#next#matches</span>
</p>
`,
);
});
});

0 comments on commit 7146506

Please sign in to comment.