import {test, expect} from '../../fixtures/test' // text-transform CSS property controls letter casing: uppercase, lowercase, // capitalize. Instructors use this for headings and callouts. canvas-rce // must preserve the CSS property — stripping it silently changes visual output. test.describe('text-transform CSS property', () => { 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('text-transform: uppercase text content is preserved', async ({page}) => { const content = await setAndGet( page, '

important notice

', ) // The underlying text must survive — CSS controls display, not actual chars expect(content).toContain('important notice') }) test('text-transform: capitalize on heading content is preserved', async ({page}) => { const content = await setAndGet( page, '

chapter one introduction

', ) expect(content).toContain('chapter one introduction') expect(content).toMatch(/

{ const content = await setAndGet( page, '

ALL CAPS INPUT

', ) expect(content).toContain('ALL CAPS INPUT') }) test('text-transform: none (explicit reset) is handled', async ({page}) => { const content = await setAndGet( page, '

Normal casing preserved.

', ) expect(content).toContain('Normal casing preserved') }) test('text-transform combined with font-weight preserves content', async ({page}) => { const content = await setAndGet( page, '

bold uppercase label

', ) expect(content).toContain('bold uppercase label') expect(content).toMatch(/ { const content = await setAndGet( page, '

first second phrase

', ) expect(content).toContain('first') expect(content).toContain('second phrase') }) })