import {test, expect} from '../../fixtures/test' //
elements appear in imported HTML and in Canvas content authored outside // the RCE (e.g. via API). TinyMCE may convert
to

or strip it; // tests document the actual round-trip behavior so refactors don't change it. test.describe('

as block container', () => { 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('plain
text content survives round-trip', async ({page}) => { const content = await setAndGet(page, '
Simple div text
') expect(content).toContain('Simple div text') }) test('multiple sibling
s all preserve their text', async ({page}) => { const content = await setAndGet( page, '
First block
Second block
Third block
', ) expect(content).toContain('First block') expect(content).toContain('Second block') expect(content).toContain('Third block') }) test('
with inline styles preserves text', async ({page}) => { const content = await setAndGet( page, '
Styled div
', ) expect(content).toContain('Styled div') }) test('
with class attribute — text preserved', async ({page}) => { const content = await setAndGet(page, '
Callout text
') expect(content).toContain('Callout text') }) test('nested
s preserve inner text', async ({page}) => { const content = await setAndGet(page, '
Deeply nested text
') expect(content).toContain('Deeply nested text') }) test('
containing

children survives', async ({page}) => { const content = await setAndGet( page, '

Paragraph inside div

Another paragraph

', ) expect(content).toContain('Paragraph inside div') expect(content).toContain('Another paragraph') }) test('
with id attribute — text preserved', async ({page}) => { const content = await setAndGet( page, '

Introduction content

', ) expect(content).toContain('Introduction content') }) test('
mixing inline and block children preserves all text', async ({page}) => { const content = await setAndGet( page, '
Bold label: inline text

Block paragraph

', ) expect(content).toContain('Bold label') expect(content).toContain('inline text') expect(content).toContain('Block paragraph') }) })