import {test, expect} from '../../fixtures/test' // ARIA 1.1+ extended properties fill gaps in the base set — aria-details links // to a full description element, aria-errormessage points to validation error // text, aria-keyshortcuts advertises keyboard shortcuts, aria-roledescription // overrides the accessible role name, aria-placeholder suggests expected input. // Canvas form elements and rich widgets rely on these for screen reader users. test.describe('ARIA extended properties (1.1+)', () => { 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-details linking to description block — label preserved', async ({page}) => { const content = await setAndGet( page, '

This field accepts ISO 8601 date formats only.

Due date field details above.

', ) expect(content).toContain('ISO 8601 date formats') expect(content).toContain('Due date field details') }) test('aria-errormessage on invalid field — error text preserved', async ({page}) => { const content = await setAndGet( page, '

Email input with error.

', ) expect(content).toContain('valid email address') expect(content).toContain('Email input with error') }) test('aria-keyshortcuts on button — shortcut text preserved', async ({page}) => { const content = await setAndGet( page, '

Save (Alt+S) — submits the form without closing.

', ) expect(content).toContain('Save') expect(content).toContain('submits the form') }) test('aria-roledescription on custom widget — description preserved', async ({page}) => { const content = await setAndGet( page, '

Introduction to the course objectives and learning outcomes.

', ) expect(content).toContain('Introduction to the course') expect(content).toContain('learning outcomes') }) test('aria-placeholder on editable region — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Response area: Sample answer text goes here.

', ) expect(content).toContain('Response area') expect(content).toContain('Sample answer text') }) test('multiple extended aria attrs on one element — text preserved', async ({page}) => { const content = await setAndGet( page, '

Form saved successfully at 3:45 PM.

', ) expect(content).toContain('Form saved successfully') }) })