import {test, expect} from '../../fixtures/test' // ARIA table attributes extend native table semantics for complex grids: // aria-sort marks sortable column headers, aria-rowcount/aria-colcount // communicate total size for virtual scroll grids, aria-rowindex/aria-colindex // identify position within the full grid. Course grade tables and schedules use these. test.describe('ARIA table and grid 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-sort="ascending" on th — text preserved', async ({page}) => { const content = await setAndGet( page, '
Name ↑Score
Alice95
', ) expect(content).toContain('Name') expect(content).toContain('Alice') }) test('aria-sort="descending" — header text preserved', async ({page}) => { const content = await setAndGet( page, '
Date ↓Event
2025-01-15Exam
', ) expect(content).toContain('Date') expect(content).toContain('Exam') }) test('aria-rowcount and aria-colcount — cell text preserved', async ({page}) => { const content = await setAndGet( page, '
IDName
001Alice
', ) expect(content).toContain('Alice') }) test('aria-colspan / aria-rowspan — text preserved', async ({page}) => { const content = await setAndGet( page, '
Merged cell content
LeftRight
', ) expect(content).toContain('Merged cell content') expect(content).toContain('Left') expect(content).toContain('Right') }) test('aria-readonly on grid cell — text preserved', async ({page}) => { const content = await setAndGet( page, '
Read-only grade value
', ) expect(content).toContain('Read-only grade value') }) })