import {test, expect} from '../../fixtures/test' // CSS Grid and Flexbox appear in modern course content layouts — // side-by-side content, image galleries, and responsive card grids. // Text content must be preserved even if TinyMCE strips or modifies // the layout-specific CSS properties. test.describe('CSS grid and flexbox layout properties', () => { 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('flex container with children — all text preserved', async ({page}) => { const content = await setAndGet( page, '
Left column
Right column
', ) expect(content).toContain('Left column') expect(content).toContain('Right column') }) test('flex with align-items and justify-content — text preserved', async ({page}) => { const content = await setAndGet( page, '
Item AItem BItem C
', ) expect(content).toContain('Item A') expect(content).toContain('Item B') expect(content).toContain('Item C') }) test('flex-wrap row layout — text preserved', async ({page}) => { const content = await setAndGet( page, '
Card One
Card Two
', ) expect(content).toContain('Card One') expect(content).toContain('Card Two') }) test('grid template columns — text preserved', async ({page}) => { const content = await setAndGet( page, '
Grid cell 1
Grid cell 2
Grid cell 3
', ) expect(content).toContain('Grid cell 1') expect(content).toContain('Grid cell 3') }) test('grid with gap property — text preserved', async ({page}) => { const content = await setAndGet( page, '

First

Second

', ) expect(content).toContain('First') expect(content).toContain('Second') }) test('grid-area / grid-column-span — text preserved', async ({page}) => { const content = await setAndGet( page, '
Full width header
Left
Right
', ) expect(content).toContain('Full width header') expect(content).toContain('Left') expect(content).toContain('Right') }) test('aspect-ratio property — text preserved', async ({page}) => { const content = await setAndGet( page, '
Video placeholder text
', ) expect(content).toContain('Video placeholder text') }) })