import {test, expect} from '../../fixtures/test' // object-fit and object-position control how replaced content (img, video) // fills its container box. Used by instructors for consistent image thumbnails, // hero images, and profile photos in course content. Text context must survive. test.describe('CSS object-fit and object-position 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('object-fit: cover on img — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Thumbnail image:

Course photo

Caption here.

', ) expect(content).toContain('Thumbnail image') expect(content).toContain('Caption here') }) test('object-fit: contain — alt text preserved', async ({page}) => { const content = await setAndGet( page, 'Circuit diagram', ) expect(content).toContain('Circuit diagram') }) test('object-fit: fill — text around preserved', async ({page}) => { const content = await setAndGet( page, '

Before image

Banner

After image

', ) expect(content).toContain('Before image') expect(content).toContain('After image') }) test('object-position — text preserved', async ({page}) => { const content = await setAndGet( page, 'Instructor portrait', ) expect(content).toContain('Instructor portrait') }) test('object-fit on video — text around preserved', async ({page}) => { const content = await setAndGet( page, '

Video preview:

', ) expect(content).toContain('Video preview') }) })