import {test, expect} from '../../fixtures/test' // ARIA menu and combobox roles appear in custom interactive course widgets: // dropdown menus for quiz answers, autocomplete search fields, select-style // exercises. Nested role structures (menu > menuitem, listbox > option) // convey widget semantics to screen readers. test.describe('ARIA menu, menuitem, combobox, listbox, and option 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="menu" with menuitems — all text preserved', async ({page}) => { const content = await setAndGet( page, '
File
Edit
View
', ) expect(content).toContain('File') expect(content).toContain('Edit') expect(content).toContain('View') }) test('role="menubar" with menus — text preserved', async ({page}) => { const content = await setAndGet( page, '
Actions
Settings
', ) expect(content).toContain('Actions') expect(content).toContain('Settings') }) test('role="listbox" with options — all text preserved', async ({page}) => { const content = await setAndGet( page, '
Option A: Linear time
Option B: Logarithmic time
Option C: Quadratic time
', ) expect(content).toContain('Option A: Linear time') expect(content).toContain('Option B: Logarithmic time') expect(content).toContain('Option C: Quadratic time') }) test('role="combobox" pattern — label and input text preserved', async ({page}) => { const content = await setAndGet( page, '', ) expect(content).toContain('Select a topic') expect(content).toContain('Choose topic') }) test('role="menuitemcheckbox" — text preserved', async ({page}) => { const content = await setAndGet( page, '
Show line numbers
Word wrap
', ) expect(content).toContain('Show line numbers') expect(content).toContain('Word wrap') }) test('role="menuitemradio" group — all items preserved', async ({page}) => { const content = await setAndGet( page, '
Small text
Medium text
Large text
', ) expect(content).toContain('Small text') expect(content).toContain('Large text') }) })