From ee685966249e5e8b7de4ddd35faa33d8c9cd4668 Mon Sep 17 00:00:00 2001 From: umaranis Date: Sat, 31 Aug 2024 10:48:17 +1000 Subject: [PATCH] test: add a new test for line deletion --- .../src/__tests__/e2e/Selection.spec.mjs | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/demos/playground/src/__tests__/e2e/Selection.spec.mjs b/demos/playground/src/__tests__/e2e/Selection.spec.mjs index 4632269..0faabdc 100644 --- a/demos/playground/src/__tests__/e2e/Selection.spec.mjs +++ b/demos/playground/src/__tests__/e2e/Selection.spec.mjs @@ -216,6 +216,52 @@ test.describe('Selection', () => { ); }); + test('can delete line which ends with element with CMD+delete', async ({ + page, + isPlainText, + }) => { + test.skip(isPlainText || !IS_MAC); + await focusEditor(page); + await page.keyboard.type('One'); + await page.keyboard.press('Enter'); + await page.keyboard.type('Two'); + // sample image + await pasteFromClipboard(page, { + 'text/html': ` + +
+ Yellow flower in tilt shift lens +
+
+ `, + }); + + const deleteLine = async () => { + await keyDownCtrlOrMeta(page); + await page.keyboard.press('Backspace'); + await keyUpCtrlOrMeta(page); + }; + + await deleteLine(); + await assertHTML( + page, + html` +

+ One +

+ `, + ); + await deleteLine(); + await assertHTML( + page, + html` +


+ `, + ); + }); + test('Can insert inline element within text and put selection after it', async ({ page, isPlainText,