Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical-playground] Refactor: switch headings test file names #7008

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
`,
);
});
Loading