Skip to content

Commit

Permalink
[lexical-playground] Refactor: switch headings test file names (faceb…
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhg authored Jan 1, 2025
1 parent 7c21d4f commit 85c08b6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
*
*/

import {
moveRight,
moveToEditorBeginning,
STANDARD_KEYPRESS_DELAY_MS,
} from '../../keyboardShortcuts/index.mjs';
import {
assertHTML,
click,
Expand All @@ -20,10 +15,10 @@ import {
test,
} from '../../utils/index.mjs';

test(`Headings - stays as a heading when you press enter in the middle of a heading`, async ({
test('Headings - changes to a paragraph when you press enter at the end of a heading', async ({
page,
isCollab,
isPlainText,
isCollab,
}) => {
test.skip(isPlainText);
await initialize({isCollab, page});
Expand All @@ -45,10 +40,6 @@ test(`Headings - stays as a heading when you press enter in the middle of a head
`,
);

await moveToEditorBeginning(page);

await moveRight(page, 5, STANDARD_KEYPRESS_DELAY_MS);

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

await assertHTML(
Expand All @@ -57,13 +48,9 @@ test(`Headings - stays as a heading when you press enter in the middle of a head
<h1
class="PlaygroundEditorTheme__h1 PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">Welco</span>
</h1>
<h1
class="PlaygroundEditorTheme__h1 PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">me to the playground</span>
<span data-lexical-text="true">Welcome to the playground</span>
</h1>
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
*
*/

import {
moveRight,
moveToEditorBeginning,
STANDARD_KEYPRESS_DELAY_MS,
} from '../../keyboardShortcuts/index.mjs';
import {
assertHTML,
click,
Expand All @@ -15,10 +20,10 @@ import {
test,
} from '../../utils/index.mjs';

test('Headings - changes to a paragraph when you press enter at the end of a heading', async ({
test(`Headings - stays as a heading when you press enter in the middle of a heading`, async ({
page,
isPlainText,
isCollab,
isPlainText,
}) => {
test.skip(isPlainText);
await initialize({isCollab, page});
Expand All @@ -40,6 +45,10 @@ test('Headings - changes to a paragraph when you press enter at the end of a hea
`,
);

await moveToEditorBeginning(page);

await moveRight(page, 5, STANDARD_KEYPRESS_DELAY_MS);

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

await assertHTML(
Expand All @@ -48,9 +57,13 @@ test('Headings - changes to a paragraph when you press enter at the end of a hea
<h1
class="PlaygroundEditorTheme__h1 PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">Welcome to the playground</span>
<span data-lexical-text="true">Welco</span>
</h1>
<h1
class="PlaygroundEditorTheme__h1 PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">me to the playground</span>
</h1>
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
});

0 comments on commit 85c08b6

Please sign in to comment.