diff --git a/demos/playground/src/__tests__/e2e/Selection.spec.mjs b/demos/playground/src/__tests__/e2e/Selection.spec.mjs index b492487..d000d80 100644 --- a/demos/playground/src/__tests__/e2e/Selection.spec.mjs +++ b/demos/playground/src/__tests__/e2e/Selection.spec.mjs @@ -7,7 +7,10 @@ */ import { + deleteForward, moveLeft, + moveRight, + moveToEditorBeginning, moveToLineBeginning, moveToPrevWord, pressShiftEnter, @@ -22,8 +25,10 @@ import { focusEditor, html, initialize, + insertCollapsible, insertImageCaption, insertSampleImage, + insertTable, IS_MAC, keyDownCtrlOrMeta, keyUpCtrlOrMeta, @@ -281,4 +286,70 @@ test.describe('Selection', () => { `, ); }); + + test.fixme('Can delete forward a Collapsible', async ({ page, isPlainText }) => { + test.skip(isPlainText); + if (!IS_MAC) { + // Do Windows/Linux have equivalent shortcuts? + return; + } + await focusEditor(page); + await page.keyboard.type('abc'); + await insertCollapsible(page); + await moveToEditorBeginning(page); + await moveRight(page, 3); + await deleteForward(page); + + await assertHTML( + page, + html` +

+ abc +

+


+ `, + ); + }); + + // TODO I don't think this test is correct but at least this test will prevent it from regressing + // even further + test.fixme('Can delete forward a Table', async ({ page, isPlainText }) => { + test.skip(isPlainText); + if (!IS_MAC) { + // Do Windows/Linux have equivalent shortcuts? + return; + } + await focusEditor(page); + await page.keyboard.type('abc'); + await insertTable(page, 1, 2); + await moveToEditorBeginning(page); + await moveRight(page, 3); + await deleteForward(page); + + await assertHTML( + page, + html` +

+ abc +

+ + + + + +
+


+
+


+
+


+ `, + ); + }); }); diff --git a/demos/playground/src/__tests__/utils/index.mjs b/demos/playground/src/__tests__/utils/index.mjs index 53f7127..c2ecacf 100644 --- a/demos/playground/src/__tests__/utils/index.mjs +++ b/demos/playground/src/__tests__/utils/index.mjs @@ -743,6 +743,10 @@ export async function insertTable(page, rows = 2, columns = 3) { ); } +export async function insertCollapsible(page) { + await selectFromInsertDropdown(page, '.item .caret-right'); +} + export async function selectCellsFromTableCords( page, firstCords,