import {test, expect} from '../../fixtures/test' // role="presentation" and role="none" tell screen readers to ignore an element's // native semantics — used for layout tables, decorative images, and spacer divs. // role="grid", role="row", role="gridcell" mark interactive data grids. // All text content must survive regardless of how TinyMCE handles these roles. test.describe('ARIA role="presentation", role="none", and grid 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('layout table with role="presentation" — cell text preserved', async ({page}) => { const content = await setAndGet( page, '
Logo areaNavigation area
', ) expect(content).toContain('Logo area') expect(content).toContain('Navigation area') }) test('role="none" on decorative div — text preserved', async ({page}) => { const content = await setAndGet( page, '
Section break

Content continues.

', ) expect(content).toContain('Content continues') }) test('role="grid" table — cell text preserved', async ({page}) => { const content = await setAndGet( page, '
NameScore
Alice95
', ) expect(content).toContain('Alice') expect(content).toContain('95') }) test('role="list" and role="listitem" — text preserved', async ({page}) => { const content = await setAndGet( page, '
First item
Second item
', ) expect(content).toContain('First item') expect(content).toContain('Second item') }) test('role="figure" and role="img" — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Chart description: most students scored B or above.

', ) expect(content).toContain('Chart description') }) test('role="separator" — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Section A content.

Section B content.

', ) expect(content).toContain('Section A content') expect(content).toContain('Section B content') }) })