import {test, expect} from '../../fixtures/test' // min-width, max-width, min-height, max-height appear in responsive course // content — limiting image sizes, constraining video embeds, and setting // readable text column widths. These are common in imported Word/Google Docs // content and hand-crafted HTML. test.describe('CSS min/max width and height 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('max-width on paragraph — text preserved', async ({page}) => { const content = await setAndGet( page, '

Readable width paragraph text content.

', ) expect(content).toContain('Readable width paragraph text content') }) test('min-width on table — text preserved', async ({page}) => { const content = await setAndGet( page, '
Minimum width table cell
', ) expect(content).toContain('Minimum width table cell') }) test('max-height with overflow — text preserved', async ({page}) => { const content = await setAndGet( page, '
Scrollable content area text.
', ) expect(content).toContain('Scrollable content area text') }) test('min-height on div — text preserved', async ({page}) => { const content = await setAndGet( page, '
Minimum height container.
', ) expect(content).toContain('Minimum height container') }) test('max-width: 100% on image — no crash', async ({page}) => { const content = await setAndGet( page, '

Responsive image: Responsive image below text.

', ) expect(content).toContain('Responsive image') expect(content).toContain('below text') }) test('width range constraints combined — text preserved', async ({page}) => { const content = await setAndGet( page, '
Constrained width container text.
', ) expect(content).toContain('Constrained width container text') }) test('viewport unit dimensions — text preserved', async ({page}) => { const content = await setAndGet( page, '
Viewport unit sized content.
', ) expect(content).toContain('Viewport unit sized content') }) })