import {test, expect} from '../../fixtures/test' // Realistic Canvas assignment description HTML combines all content types: // headings, paragraphs, lists, tables, links to course files, rubric info, // due date info, and submission instructions. These full-page patterns are // the primary use case for canvas-rce and the most important to keep intact. test.describe('Canvas assignment description 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('assignment with overview, requirements, submission — all text preserved', async ({ page, }) => { const content = await setAndGet( page, `

Research Paper Assignment

Due: Friday, March 15 at 11:59 PM

Overview

Write a 5–7 page research paper on a topic from the list below.

Requirements

Submission

Submit as a PDF via the submission portal.

`, ) expect(content).toContain('Research Paper Assignment') expect(content).toContain('peer-reviewed sources') expect(content).toContain('submission portal') }) test('assignment with grading table and file links — all preserved', async ({page}) => { const content = await setAndGet( page, `

Lab Report: Photosynthesis

Complete the lab experiment and submit your report using the lab report template.

Grading Breakdown

SectionPoints
Introduction and Hypothesis20
Methods15
Results and Discussion40
Conclusion25

Total: 100 points

`, ) expect(content).toContain('Lab Report: Photosynthesis') expect(content).toContain('lab report template') expect(content).toContain('Introduction and Hypothesis') expect(content).toContain('Total: 100 points') }) test('programming assignment with code examples — code preserved', async ({page}) => { const content = await setAndGet( page, `

Assignment 3: Binary Search Tree

Implement a BST with the following interface:

class BST:
    def insert(self, value): pass
    def search(self, value): pass
    def delete(self, value): pass

Test Cases

Your implementation must pass all provided test cases in test_bst.py.

`, ) expect(content).toContain('Binary Search Tree') expect(content).toContain('def insert') expect(content).toContain('test_bst.py') }) })