import {test, expect} from '../../fixtures/test' // Canvas syllabi are the most-read documents in a course — instructors spend // significant time formatting them. They contain weekly schedules, grading // breakdowns, late-policy tables, contact information, and accessibility // statements. These realistic full-syllabus patterns verify the RCE handles // dense mixed-format content without losing text. test.describe('Canvas syllabus content patterns', () => { 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('grading breakdown table — all categories and weights preserved', async ({page}) => { const content = await setAndGet( page, `

Grading

ComponentWeightNotes
Weekly Quizzes (10)20%Lowest score dropped
Midterm Exam25%In-person, closed book
Research Paper30%3000-word minimum
Final Exam25%Comprehensive
`, ) expect(content).toContain('Weekly Quizzes') expect(content).toContain('Lowest score dropped') expect(content).toContain('Research Paper') expect(content).toContain('3000-word minimum') expect(content).toContain('Comprehensive') }) test('weekly schedule section — dates and topics preserved', async ({page}) => { const content = await setAndGet( page, `

Course Schedule

  1. Week 1 (Jan 13): Introduction to Sociology — Read Giddens Ch. 1
  2. Week 2 (Jan 20): Culture and Society — Read Giddens Ch. 2-3; Quiz 1
  3. Week 3 (Jan 27): Social Stratification — Read Giddens Ch. 4; Discussion post due
  4. Week 4 (Feb 3): Race and Ethnicity — Guest lecture; Response paper due
`, ) expect(content).toContain('Introduction to Sociology') expect(content).toContain('Culture and Society') expect(content).toContain('Social Stratification') expect(content).toContain('Race and Ethnicity') expect(content).toContain('Response paper due') }) test('late policy section — policy text preserved', async ({page}) => { const content = await setAndGet( page, `

Late Work Policy

Assignments submitted after the deadline will be penalized as follows:

Exceptions may be granted for documented medical emergencies. Contact the instructor before the deadline whenever possible.

`, ) expect(content).toContain('10% deduction') expect(content).toContain('not accepted') expect(content).toContain('documented medical emergencies') }) test('accessibility statement — full paragraph text preserved', async ({page}) => { const content = await setAndGet( page, `

Accessibility Statement

Students who require academic accommodations due to a disability should contact the Office of Disability Services (ODS) at ods@university.edu or call 555-0100. Accommodations are not retroactive, so please contact ODS early in the semester.

All course materials are available in accessible formats. If you encounter accessibility barriers, please notify the instructor immediately.

`, ) expect(content).toContain('Office of Disability Services') expect(content).toContain('Accommodations are not retroactive') expect(content).toContain('accessible formats') }) test('instructor contact block — contact info preserved', async ({page}) => { const content = await setAndGet( page, `

Instructor Information

Professor: Dr. Sarah Okonkwo
Office: Liberal Arts Building, Room 214
Office Hours: Monday/Wednesday 10:00 AM - 12:00 PM
Email: sokonkwo@university.edu (response within 24 hours)

For urgent matters, post in the course discussion board rather than email.

`, ) expect(content).toContain('Liberal Arts Building') expect(content).toContain('response within 24 hours') expect(content).toContain('course discussion board') }) })