import {test, expect} from '../../fixtures/test' // and are HTML5 elements for displaying completion and // measurement. They appear in interactive course content and rubrics. // TinyMCE may strip or preserve them — tests document actual behavior so // a refactor doesn't accidentally change what students see in course pages. test.describe(' and elements', () => { 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(' fallback text is preserved', async ({page}) => { const content = await setAndGet( page, '

Course completion: 75%

', ) expect(content).toContain('Course completion') // element may be stripped or preserved — surrounding text must survive expect(typeof content).toBe('string') expect(content.length).toBeGreaterThan(0) }) test(' fallback text is preserved', async ({page}) => { const content = await setAndGet( page, '

Score: 80%

', ) expect(content).toContain('Score') expect(typeof content).toBe('string') }) test('text around elements is always preserved', async ({page}) => { const content = await setAndGet( page, '

Before: 50% :After

', ) expect(content).toContain('Before') expect(content).toContain('After') }) test(' with title attribute — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Grade: 92/100

', ) expect(content).toContain('Grade') }) test('multiple meter elements in a table — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '
Quiz 190%
Quiz 270%
', ) expect(content).toContain('Quiz 1') expect(content).toContain('Quiz 2') }) })