import {test, expect} from '../../fixtures/test' // Table insertion: Table menu → Table → click a cell in the picker grid // Or use TinyMCE execCommand for reliable insertion. test.describe('tables', () => { test.beforeEach(async ({page, rcePage}) => { await page.goto('/scenarios/basic') await rcePage.waitForEditor() await rcePage.contentFrame().locator('body').click() }) async function insertTable(page: any, rows: number, cols: number) { // Use TinyMCE's execCommand to insert a table — avoids grid-picker flakiness await page.evaluate( ({r, c}: {r: number; c: number}) => { // @ts-expect-error -- TinyMCE global window.tinymce.activeEditor.execCommand('mceInsertTable', false, {rows: r, columns: c}) }, {r: rows, c: cols}, ) } test('inserting a 2x2 table renders
| ]*>.*?<\/td>/gs) ?? [] expect(cells.some(c => c.includes('A'))).toBe(true) expect(cells.some(c => c.includes('B'))).toBe(true) }) }) |