import {test, expect} from '../../fixtures/test' // HTML4 table presentation attributes (frame, rules, border) appear in content // migrated from legacy CMS systems into Canvas. frame controls which outer // borders appear, rules controls which inner dividers show, border sets width. // Canvas instructors paste this content from old course exports; the cell // text must survive regardless of whether TinyMCE preserves the attributes. test.describe('legacy table frame and rules 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 frame="box" — cell content preserved', async ({page}) => { const content = await setAndGet( page, '
CourseCredits
Introduction to Biology4
', ) expect(content).toContain('Introduction to Biology') expect(content).toContain('Credits') }) test('table with rules="rows" — row data preserved', async ({page}) => { const content = await setAndGet( page, '
Grade Distribution
GradeCount
A12
B18
', ) expect(content).toContain('Grade Distribution') expect(content).toContain('Count') }) test('table with rules="cols" — column headers preserved', async ({page}) => { const content = await setAndGet( page, '
WeekTopicReading
1IntroductionChapter 1-2
', ) expect(content).toContain('Chapter 1-2') expect(content).toContain('Topic') }) test('table with rules="all" and cellpadding — content preserved', async ({page}) => { const content = await setAndGet( page, '
Assignment NameDue DatePoints
Lab ReportFriday50
', ) expect(content).toContain('Assignment Name') expect(content).toContain('Lab Report') expect(content).toContain('Points') }) test('table with frame="hsides" — header and data preserved', async ({page}) => { const content = await setAndGet( page, '
CategoryScore
Participation95
', ) expect(content).toContain('Participation') expect(content).toContain('Category') }) })