import {test, expect} from '../../fixtures/test' // Lists inside table cells are common in course materials: grading rubrics // list criteria per row, schedules list activities per day, comparison tables // show bullet points per column. TinyMCE must serialize this structure without // flattening the list or losing items. test.describe('lists nested inside table 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('ul inside td — all list items preserved', async ({page}) => { const content = await setAndGet( page, '
  • Criterion A
  • Criterion B
  • Criterion C
Score
', ) expect(content).toContain('Criterion A') expect(content).toContain('Criterion B') expect(content).toContain('Criterion C') }) test('ol inside td — ordered list preserved', async ({page}) => { const content = await setAndGet( page, '
Steps
  1. First step
  2. Second step
  3. Third step
', ) expect(content).toContain('First step') expect(content).toContain('Second step') expect(content).toContain('Third step') }) test('multiple cells each with a list — all items preserved', async ({page}) => { const content = await setAndGet( page, '
  • Pros: Fast
  • Pros: Cheap
  • Cons: Complex
  • Cons: Risky
', ) expect(content).toContain('Pros: Fast') expect(content).toContain('Cons: Complex') }) test('nested list inside table cell — all levels preserved', async ({page}) => { const content = await setAndGet( page, '
  • Main item
    • Sub-item A
    • Sub-item B
  • Another main
', ) expect(content).toContain('Main item') expect(content).toContain('Sub-item A') expect(content).toContain('Another main') }) test('schedule table: days with activity lists — all preserved', async ({page}) => { const content = await setAndGet( page, `
MondayWednesday
  • Read chapter 1
  • Quiz prep
  • Lab session
  • Office hours
`, ) expect(content).toContain('Read chapter 1') expect(content).toContain('Lab session') expect(content).toContain('Office hours') }) })