From 76965808f28d58e2019b526b5b243328c9968e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Hamburger=20Gr=C3=B8ngaard?= Date: Tue, 31 Dec 2024 10:38:02 +0100 Subject: [PATCH] [lexical-playground] Refactor: switch headings test file names `HeadingsEnterAtEnd.spec.mjs` was called `HeadingsEnterInMiddle.spec.mjs` and `HeadingsEnterInMiddle.spec.mjs` was called `HeadingsEnterAtEnd.spec.mjs`. Now the file names have been switched. --- .../e2e/Headings/HeadingsEnterAtEnd.spec.mjs | 21 ++++--------------- .../Headings/HeadingsEnterInMiddle.spec.mjs | 21 +++++++++++++++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterAtEnd.spec.mjs b/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterAtEnd.spec.mjs index c5539928406..5a15096e412 100644 --- a/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterAtEnd.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterAtEnd.spec.mjs @@ -6,11 +6,6 @@ * */ -import { - moveRight, - moveToEditorBeginning, - STANDARD_KEYPRESS_DELAY_MS, -} from '../../keyboardShortcuts/index.mjs'; import { assertHTML, click, @@ -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}); @@ -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( @@ -57,13 +48,9 @@ test(`Headings - stays as a heading when you press enter in the middle of a head

- Welco -

-

- me to the playground + Welcome to the playground

+


`, ); }); diff --git a/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterInMiddle.spec.mjs b/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterInMiddle.spec.mjs index 5a15096e412..c5539928406 100644 --- a/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterInMiddle.spec.mjs +++ b/packages/lexical-playground/__tests__/e2e/Headings/HeadingsEnterInMiddle.spec.mjs @@ -6,6 +6,11 @@ * */ +import { + moveRight, + moveToEditorBeginning, + STANDARD_KEYPRESS_DELAY_MS, +} from '../../keyboardShortcuts/index.mjs'; import { assertHTML, click, @@ -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}); @@ -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( @@ -48,9 +57,13 @@ test('Headings - changes to a paragraph when you press enter at the end of a hea

- Welcome to the playground + Welco +

+

+ me to the playground

-


`, ); });