import {test, expect} from '../../fixtures/test' // CSS position properties (relative, absolute, fixed, sticky) control element // placement. They appear in callout boxes, floating images, and sticky headers // in course content. TinyMCE may preserve or strip these — text must survive. test.describe('CSS position properties in inline styles', () => { 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('position: relative — text preserved', async ({page}) => { const content = await setAndGet( page, '

Relative positioned paragraph

', ) expect(content).toContain('Relative positioned paragraph') }) test('position: absolute with offset — text preserved', async ({page}) => { const content = await setAndGet( page, '
Absolute text
', ) expect(content).toContain('Absolute text') }) test('position: sticky — text preserved', async ({page}) => { const content = await setAndGet( page, '

Sticky header text

Body content.

', ) expect(content).toContain('Sticky header text') expect(content).toContain('Body content') }) test('z-index with positioned element — text preserved', async ({page}) => { const content = await setAndGet( page, '
Layered content
', ) expect(content).toContain('Layered content') }) test('float: left on image — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, 'floated image

Text wrapping around floated image here.

', ) expect(content).toContain('Text wrapping around floated image here') }) test('clear: both — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, 'img

Text after float cleared

', ) expect(content).toContain('Text after float cleared') }) })