Skip to content

Commit

Permalink
test: Fix insertTableColumn when rowSpan > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Nov 28, 2023
1 parent 3fc69c0 commit d6ea424
Showing 1 changed file with 55 additions and 1 deletion.
56 changes: 55 additions & 1 deletion demos/playground/src/__tests__/e2e/Tables.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,61 @@ test.describe('Tables', () => {
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</th>
<td class="PlaygroundEditorTheme__tableCell"><br /></td>
<td class="PlaygroundEditorTheme__tableCell">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
<td class="PlaygroundEditorTheme__tableCell">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
</tr>
</table>
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
`,
);
});

test('Insert column before (with selected cell with rowspan > 1)', 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 insertTable(page, 2, 1);

await click(page, '.PlaygroundEditorTheme__tableCell');
await selectCellsFromTableCords(
page,
{ x: 0, y: 0 },
{ x: 0, y: 1 },
true,
true,
);
await mergeTableCells(page);
await insertTableColumnBefore(page);
await page.pause();

await assertHTML(
page,
html`
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
<table class="PlaygroundEditorTheme__table">
<tr>
<td class="PlaygroundEditorTheme__tableCell">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
rowspan="2">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</th>
</tr>
<tr>
<td class="PlaygroundEditorTheme__tableCell">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
Expand Down

0 comments on commit d6ea424

Please sign in to comment.