import {test, expect} from '../../fixtures/test' // Elements with multiple CSS class names appear throughout Canvas course content: // framework utility classes (Bootstrap, InstUI), Canvas-specific classes // (instructure_file_link, equation_image), and custom instructor classes. // Multiple classes must survive round-trips as a space-separated string. test.describe('elements with multiple CSS class names', () => { 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('span with two classes — text preserved', async ({page}) => { const content = await setAndGet( page, '

Highlighted warning text

', ) expect(content).toContain('Highlighted warning text') }) test('div with three classes — text preserved', async ({page}) => { const content = await setAndGet( page, '
Info callout content
', ) expect(content).toContain('Info callout content') }) test('Canvas file link with multiple classes — text preserved', async ({page}) => { const content = await setAndGet( page, 'Assignment Brief.pdf', ) expect(content).toContain('Assignment Brief.pdf') }) test('img with multiple classes including equation_image — alt preserved', async ({page}) => { const content = await setAndGet( page, 'f(x) equals x squared', ) // alt text or surrounding structure should be present expect(typeof content).toBe('string') }) test('5 classes on one element — text preserved', async ({page}) => { const content = await setAndGet( page, '
Five class div content
', ) expect(content).toContain('Five class div content') }) test('table with border and class — text preserved', async ({page}) => { const content = await setAndGet( page, '
Table cell
', ) expect(content).toContain('Table cell') }) test('nested elements each with multiple classes — text preserved', async ({page}) => { const content = await setAndGet( page, '
', ) expect(content).toContain('Featured introduction paragraph text') }) })