import {test, expect} from '../../fixtures/test' // ARIA relationship attributes (aria-describedby, aria-controls, aria-labelledby, // aria-expanded, aria-owns) link elements by id for screen readers. // Course content with interactive widgets (tabs, accordions, tooltips) uses these. // They must survive round-trips so accessibility relationships aren't broken. test.describe('ARIA relationship attributes', () => { 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('aria-describedby linking description — text preserved', async ({page}) => { const content = await setAndGet( page, '

Enter your student ID number (8 digits).

Student ID field

', ) expect(content).toContain('Enter your student ID') expect(content).toContain('Student ID field') }) test('aria-labelledby cross-reference — text preserved', async ({page}) => { const content = await setAndGet( page, '

Module 3: Data Structures

Section content.

', ) expect(content).toContain('Module 3: Data Structures') expect(content).toContain('Section content') }) test('aria-controls on button pattern — text preserved', async ({page}) => { const content = await setAndGet( page, '

The hidden answer text.

', ) expect(content).toContain('Toggle Answer') expect(content).toContain('hidden answer text') }) test('aria-expanded="true" — text preserved', async ({page}) => { const content = await setAndGet( page, '
Show Less

Expanded details content.

', ) expect(content).toContain('Show Less') expect(content).toContain('Expanded details content') }) test('aria-owns attribute — text preserved', async ({page}) => { const content = await setAndGet( page, '
  • Virtual item
  • ', ) expect(content).toContain('Item One') expect(content).toContain('Item Two') }) test('aria-flowto chaining — text preserved', async ({page}) => { const content = await setAndGet( page, '

    Step 1: Gather materials.

    Step 2: Begin assembly.

    ', ) expect(content).toContain('Step 1: Gather materials') expect(content).toContain('Step 2: Begin assembly') }) })