import {test, expect} from '../../fixtures/test' // Tables with mixed cell content — paragraphs, images, lists, headings, and // code — appear in rubrics, comparison charts, and reference tables. // TinyMCE's serializer must handle the mixed block/inline model inside td/th // without flattening or dropping content types. test.describe('tables with mixed block content in cells', () => { test.beforeEach(async ({page, rcePage}) => { await page.goto('/scenarios/basic') await rcePage.waitForEditor() }) async function setAndGet(page: any, html: string): Promise { return page.evaluate((content: string) => { // @ts-expect-error -- TinyMCE global window.tinymce.activeEditor.setContent(content) // @ts-expect-error -- TinyMCE global return window.tinymce.activeEditor.getContent() }, html) } test('table cell with heading and paragraph — both preserved', async ({page}) => { const content = await setAndGet( page, '

Key Concept

Detailed explanation of the concept.

Score
', ) expect(content).toContain('Key Concept') expect(content).toContain('Detailed explanation') }) test('table cell with image and caption — text preserved', async ({page}) => { const content = await setAndGet( page, '
Process diagram

Figure 1: Process flow

Description text
', ) expect(content).toContain('Process diagram') expect(content).toContain('Figure 1: Process flow') expect(content).toContain('Description text') }) test('comparison table: cell with code block — code preserved', async ({page}) => { const content = await setAndGet( page, '
LanguageExample
Python
print("Hello")
JavaScript
console.log("Hello")
', ) expect(content).toContain('Python') expect(content).toContain('print("Hello")') expect(content).toContain('console.log("Hello")') }) test('rubric table with criteria lists — all items preserved', async ({page}) => { const content = await setAndGet( page, '
CriterionExcellent (4)Good (3)
Analysis
  • Deep insight
  • Novel perspective
  • Solid analysis
  • Clear reasoning
', ) expect(content).toContain('Analysis') expect(content).toContain('Deep insight') expect(content).toContain('Solid analysis') }) test('table cell with bold, italic, and link — all preserved', async ({page}) => { const content = await setAndGet( page, '

Required reading: Introduction to Algorithms by MIT Press.

', ) expect(content).toContain('Required reading') expect(content).toContain('Introduction to Algorithms') expect(content).toContain('MIT Press') }) })