import {test, expect} from '../../fixtures/test' // The `summary` attribute on was deprecated in HTML5 but still appears // in legacy Canvas course content exported from older LMS systems or Word. // Additionally, `scope`, `headers`, `axis`, and `abbr` on
/ carry // accessibility semantics for complex data tables used in rubrics and schedules. test.describe('table accessibility and legacy 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('table with summary attribute — cell text preserved', async ({page}) => { const content = await setAndGet( page, '
DayTime
Monday9:00 AM
', ) expect(content).toContain('Monday') expect(content).toContain('9:00 AM') }) test('th with abbr attribute — text preserved', async ({page}) => { const content = await setAndGet( page, '
Student NameFinal Grade
Jane DoeA
', ) expect(content).toContain('Student Name') expect(content).toContain('Jane Doe') }) test('td with headers attribute — text preserved', async ({page}) => { const content = await setAndGet( page, '
NameScore
Alice95
', ) expect(content).toContain('Alice') expect(content).toContain('95') }) test('th with scope="colgroup" — text preserved', async ({page}) => { const content = await setAndGet( page, '
WeekGrades
18892
', ) expect(content).toContain('Week') expect(content).toContain('Grades') expect(content).toContain('88') }) test('table with axis attribute on cells — text preserved', async ({page}) => { const content = await setAndGet( page, '
Participation10
', ) expect(content).toContain('Participation') expect(content).toContain('10') }) })