Skip to content

Commit

Permalink
test: fix tables Webkit e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed May 15, 2023
1 parent 3690fd0 commit dc8386a
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions demos/playground/src/__tests__/e2e/Tables.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '../keyboardShortcuts/index.mjs';
import {
assertHTML,
assertSelection,
click,
clickSelectors,
copyToClipboard,
Expand Down Expand Up @@ -1007,7 +1008,6 @@ test.describe('Tables', () => {
true,
);
await mergeTableCells(page);
await page.pause();

await moveRight(page, 1);
await selectCellsFromTableCords(
Expand All @@ -1018,7 +1018,6 @@ test.describe('Tables', () => {
true,
);
await mergeTableCells(page);
await page.pause();

await selectCellsFromTableCords(
page,
Expand All @@ -1027,7 +1026,6 @@ test.describe('Tables', () => {
true,
true,
);
await page.pause();

await assertHTML(
page,
Expand Down Expand Up @@ -1253,7 +1251,6 @@ test.describe('Tables', () => {
);
await mergeTableCells(page);

await page.pause();
await selectCellsFromTableCords(
page,
{x: 0, y: 0},
Expand Down Expand Up @@ -1313,18 +1310,15 @@ test.describe('Tables', () => {
);
await mergeTableCells(page);

await page.pause();
await selectCellsFromTableCords(
page,
{x: 0, y: 0},
{x: 1, y: 0},
true,
true,
);
await page.pause();

await deleteTableColumns(page);
await page.pause();

await assertHTML(
page,
Expand All @@ -1351,4 +1345,32 @@ test.describe('Tables', () => {
`,
);
});

test('Deselect when click outside #3785 #4138', async ({
page,
isPlainText,
}) => {
test.skip(isPlainText);
if (IS_COLLAB) {
// The contextual menu positioning needs fixing (it's hardcoded to show on the right side)
page.setViewportSize({height: 1000, width: 3000});
}

await focusEditor(page);

await page.keyboard.type('123');
await insertTable(page, 1, 1);
await selectAll(page);

await page.pause();
await click(page, 'div[contenteditable="true"] p:first-of-type');
await page.pause();

await assertSelection(page, {
anchorOffset: 3,
anchorPath: [0, 0, 0],
focusOffset: 3,
focusPath: [0, 0, 0],
});
});
});

0 comments on commit dc8386a

Please sign in to comment.