Skip to content

Commit

Permalink
Merge branch 'main' into fix/list-indention-format-loss
Browse files Browse the repository at this point in the history
  • Loading branch information
zurfyx authored Dec 10, 2024
2 parents 8a6ed71 + 9198eb0 commit 901c3d0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 51 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'packages/lexical-website/**'
pull_request:
types: [opened, synchronize, reopened]
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
103 changes: 52 additions & 51 deletions packages/lexical-playground/__tests__/e2e/List.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
focusEditor,
html,
initialize,
IS_LINUX,
pasteFromClipboard,
repeat,
selectFromAlignDropdown,
Expand Down Expand Up @@ -73,60 +72,62 @@ test.beforeEach(({isPlainText}) => {
test.describe.parallel('Nested List', () => {
test.beforeEach(({isCollab, page}) => initialize({isCollab, page}));

test(`Can create a list and partially copy some content out of it`, async ({
page,
isCollab,
}) => {
test.fixme(isCollab && IS_LINUX, 'Flaky on Linux + Collab');
await focusEditor(page);
await page.keyboard.type(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam venenatis risus ac cursus efficitur. Cras efficitur magna odio, lacinia posuere mauris placerat in. Etiam eu congue nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nulla vulputate justo id eros convallis, vel pellentesque orci hendrerit. Pellentesque accumsan molestie eros, vitae tempor nisl semper sit amet. Sed vulputate leo dolor, et bibendum quam feugiat eget. Praesent vestibulum libero sed enim ornare, in consequat dui posuere. Maecenas ornare vestibulum felis, non elementum urna imperdiet sit amet.',
);
await toggleBulletList(page);
await moveToEditorBeginning(page);
await moveRight(page, 6);
await selectCharacters(page, 'right', 11);
test(
`Can create a list and partially copy some content out of it`,
{
tag: '@flaky',
},
async ({page, isCollab}) => {
await focusEditor(page);
await page.keyboard.type(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam venenatis risus ac cursus efficitur. Cras efficitur magna odio, lacinia posuere mauris placerat in. Etiam eu congue nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nulla vulputate justo id eros convallis, vel pellentesque orci hendrerit. Pellentesque accumsan molestie eros, vitae tempor nisl semper sit amet. Sed vulputate leo dolor, et bibendum quam feugiat eget. Praesent vestibulum libero sed enim ornare, in consequat dui posuere. Maecenas ornare vestibulum felis, non elementum urna imperdiet sit amet.',
);
await toggleBulletList(page);
await moveToEditorBeginning(page);
await moveRight(page, 6);
await selectCharacters(page, 'right', 11);

await withExclusiveClipboardAccess(async () => {
const clipboard = await copyToClipboard(page);
await withExclusiveClipboardAccess(async () => {
const clipboard = await copyToClipboard(page);

await moveToEditorEnd(page);
await page.keyboard.press('Enter');
await page.keyboard.press('Enter');
await moveToEditorEnd(page);
await page.keyboard.press('Enter');
await page.keyboard.press('Enter');

await pasteFromClipboard(page, clipboard);
});
await pasteFromClipboard(page, clipboard);
});

await assertHTML(
page,
html`
<ul class="PlaygroundEditorTheme__ul">
<li
class="PlaygroundEditorTheme__listItem PlaygroundEditorTheme__ltr"
dir="ltr"
value="1">
<span data-lexical-text="true">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam
venenatis risus ac cursus efficitur. Cras efficitur magna odio,
lacinia posuere mauris placerat in. Etiam eu congue nisl.
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices
posuere cubilia curae; Nulla vulputate justo id eros convallis,
vel pellentesque orci hendrerit. Pellentesque accumsan molestie
eros, vitae tempor nisl semper sit amet. Sed vulputate leo dolor,
et bibendum quam feugiat eget. Praesent vestibulum libero sed enim
ornare, in consequat dui posuere. Maecenas ornare vestibulum
felis, non elementum urna imperdiet sit amet.
</span>
</li>
</ul>
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">ipsum dolor</span>
</p>
`,
);
});
await assertHTML(
page,
html`
<ul class="PlaygroundEditorTheme__ul">
<li
class="PlaygroundEditorTheme__listItem PlaygroundEditorTheme__ltr"
dir="ltr"
value="1">
<span data-lexical-text="true">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam
venenatis risus ac cursus efficitur. Cras efficitur magna odio,
lacinia posuere mauris placerat in. Etiam eu congue nisl.
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices
posuere cubilia curae; Nulla vulputate justo id eros convallis,
vel pellentesque orci hendrerit. Pellentesque accumsan molestie
eros, vitae tempor nisl semper sit amet. Sed vulputate leo
dolor, et bibendum quam feugiat eget. Praesent vestibulum libero
sed enim ornare, in consequat dui posuere. Maecenas ornare
vestibulum felis, non elementum urna imperdiet sit amet.
</span>
</li>
</ul>
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">ipsum dolor</span>
</p>
`,
);
},
);

test('Should outdent if indented when the backspace key is pressed', async ({
page,
Expand Down

0 comments on commit 901c3d0

Please sign in to comment.