import {test, expect} from '../../fixtures/test' // Realistic Canvas course page HTML — the kind of multi-section document // instructors actually save. This exercises the full serialization pipeline // with mixed headings, tables, lists, links, images, and formatted text // all in one document. A refactoring regression would show up here first. test.describe('realistic course page content pattern', () => { 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('full course page with heading hierarchy and body text', async ({page}) => { const content = await setAndGet( page, `

Introduction to Computer Science

Welcome to CS101. This course covers fundamental programming concepts using Python.

Learning Objectives

  1. Understand variables and data types
  2. Write functions and loops
  3. Apply basic algorithms

Course Schedule

WeekTopicAssignment
1Variables & TypesLab 1
2Control FlowLab 2

Resources

Visit Python docs for reference.

`, ) expect(content).toContain('Introduction to Computer Science') expect(content).toContain('fundamental programming concepts') expect(content).toContain('Learning Objectives') expect(content).toContain('Understand variables') expect(content).toContain('Course Schedule') expect(content).toContain('Control Flow') expect(content).toContain('Python docs') }) test('course announcement with formatted greeting', async ({page}) => { const content = await setAndGet( page, `

Dear students,

This week's midterm exam will cover chapters 1–5. Please review:

Office hours this week: Tuesday 3–5pm and Thursday 2–4pm.

Good luck!
Prof. Johnson

`, ) expect(content).toContain('Dear students') expect(content).toContain('midterm exam') expect(content).toContain('Data structures') expect(content).toContain('Prof. Johnson') }) test('assignment description with grading criteria', async ({page}) => { const content = await setAndGet( page, `

Assignment 3: Binary Search Tree

Due: Friday, 11:59pm | Points: 100

Requirements

Implement a BST with the following methods:

Submission

Submit via Canvas Assignments.

`, ) expect(content).toContain('Binary Search Tree') expect(content).toContain('insert(value)') expect(content).toContain('O(log n)') expect(content).toContain('Canvas Assignments') }) })