Skip to content

Commit

Permalink
Add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Lapuskin committed Dec 9, 2024
1 parent 09f76ce commit 6c43d9b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/lexical-playground/__tests__/e2e/List.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
redo,
selectAll,
selectCharacters,
toggleBold,
undo,
} from '../keyboardShortcuts/index.mjs';
import {
Expand All @@ -32,6 +33,7 @@ import {
pasteFromClipboard,
repeat,
selectFromAlignDropdown,
selectFromColorPicker,
selectFromFormatDropdown,
test,
waitForSelector,
Expand Down Expand Up @@ -158,6 +160,25 @@ test.describe.parallel('Nested List', () => {
);
});

test('Should retain selection style when exiting list', async ({page}) => {
await focusEditor(page);
await toggleBulletList(page);

await selectFromColorPicker(page);
await await focusEditor(page);
await toggleBold(page);
await page.keyboard.type('Hello');
//Double-enter to exit list
await page.keyboard.press('Enter');
await page.keyboard.press('Enter');
await page.keyboard.type('World');

await assertHTML(
page,
'<ul class="PlaygroundEditorTheme__ul"><li value="1" class="PlaygroundEditorTheme__listItem PlaygroundEditorTheme__ltr" dir="ltr"><strong class="PlaygroundEditorTheme__textBold" style="color: rgb(208, 2, 27)" data-lexical-text="true">Hello</strong></li></ul><p class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr" dir="ltr"><strong class="PlaygroundEditorTheme__textBold" style="color: rgb(208, 2, 27)" data-lexical-text="true">World</strong></p>',
);
});

test(`Can indent/outdent mutliple list nodes in a list with multiple levels of indentation`, async ({
page,
}) => {
Expand Down

0 comments on commit 6c43d9b

Please sign in to comment.