import {test, expect} from '../../fixtures/test' // role="progressbar" with aria-valuenow/valuemin/valuemax marks loading bars // and course completion indicators. role="status" marks live status regions. // role="log" marks append-only activity logs. These appear in custom // interactive course widgets and must survive TinyMCE's serialization. test.describe('ARIA live region and progress roles', () => { 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('role="progressbar" with aria-valuenow — text preserved', async ({page}) => { const content = await setAndGet( page, '

Course progress:

65%
', ) expect(content).toContain('Course progress') expect(content).toContain('65%') }) test('role="progressbar" indeterminate (no valuenow) — text preserved', async ({page}) => { const content = await setAndGet( page, '
Loading content, please wait.
', ) expect(content).toContain('Loading content') }) test('role="status" live region — text preserved', async ({page}) => { const content = await setAndGet( page, '
Saved successfully.
', ) expect(content).toContain('Saved successfully') }) test('role="log" activity log — text preserved', async ({page}) => { const content = await setAndGet( page, '

User logged in at 9:00 AM

Assignment submitted at 10:30 AM

', ) expect(content).toContain('User logged in') expect(content).toContain('Assignment submitted') }) test('role="timer" countdown — text preserved', async ({page}) => { const content = await setAndGet( page, '
45:00
', ) expect(content).toContain('45:00') }) test('role="marquee" — text preserved', async ({page}) => { const content = await setAndGet( page, '
Office hours cancelled today. Quiz rescheduled to Friday.
', ) expect(content).toContain('Office hours cancelled') expect(content).toContain('Quiz rescheduled to Friday') }) })