import {test, expect} from '../../fixtures/test' // ARIA state attributes convey interactive widget state to screen readers: // aria-current (location in set), aria-selected (chosen option), // aria-pressed (toggle button), aria-checked (checkbox/radio state). // These appear in custom course widgets and imported interactive content. test.describe('ARIA state 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-current="page" on nav link — text preserved', async ({page}) => { const content = await setAndGet( page, '', ) expect(content).toContain('Course Home') expect(content).toContain('Assignments') }) test('aria-current="step" in wizard pattern — text preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Step 1: Introduction
  2. Step 2: Materials
  3. Step 3: Procedure
', ) expect(content).toContain('Step 1: Introduction') expect(content).toContain('Step 3: Procedure') }) test('aria-selected="true" on tab — text preserved', async ({page}) => { const content = await setAndGet( page, '
Overview
Details
', ) expect(content).toContain('Overview') expect(content).toContain('Details') }) test('aria-pressed="true" on toggle — text preserved', async ({page}) => { const content = await setAndGet( page, '

Show Answer (Active)

', ) expect(content).toContain('Show Answer') }) test('aria-checked="true" on custom checkbox — text preserved', async ({page}) => { const content = await setAndGet( page, '
I agree to the terms
', ) expect(content).toContain('I agree to the terms') }) test('aria-disabled="true" on element — text preserved', async ({page}) => { const content = await setAndGet( page, '

Submit (not available yet)

', ) expect(content).toContain('Submit') }) test('aria-invalid="true" on input description — text preserved', async ({page}) => { const content = await setAndGet( page, '', ) expect(content).toContain('Error: Field is required') }) })