Skip to content

Commit

Permalink
add tests for #5703
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahejkm committed May 7, 2024
1 parent b2b13f6 commit a1e22d4
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/lexical-playground/__tests__/e2e/Hashtags.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,42 @@ test.describe('Hashtags', () => {
`,
);
});

test('Should not break while skipping invalid hashtags #5703', async ({
page,
}) => {
await focusEditor(page);
await page.keyboard.type('#hello');

await page.keyboard.press('Space');

await page.keyboard.type('#world');
await page.keyboard.type('#invalid');

await page.keyboard.press('Space');
await page.keyboard.type('#next');

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"></span>
<span class="PlaygroundEditorTheme__hashtag" data-lexical-text="true">
#world
</span>
<span data-lexical-text="true">#invalid</span>
<span class="PlaygroundEditorTheme__hashtag" data-lexical-text="true">
#next
</span>
</p>
`,
);
});
});

0 comments on commit a1e22d4

Please sign in to comment.