import {test, expect} from '../../fixtures/test' // Canvas announcements are broadcast messages from instructors to the whole // class. They often contain formatted text, links to course materials, due-date // reminders, embedded images, and collapsible sections. These realistic // announcement patterns verify the RCE handles broadcast content correctly. test.describe('Canvas announcement 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('due-date reminder announcement — all details preserved', async ({page}) => { const content = await setAndGet( page, `

Reminder: Research Paper Due Friday at 11:59 PM

This is a friendly reminder that your research paper is due this Friday. Please submit through Canvas — email submissions will not be accepted.

Requirements checklist:

Contact me at office hours (Tuesday 2-4 PM) with any last-minute questions.

`, ) expect(content).toContain('Research Paper Due Friday') expect(content).toContain('APA 7th edition') expect(content).toContain('peer-reviewed sources') expect(content).toContain('office hours') }) test('class cancellation announcement — message text preserved', async ({page}) => { const content = await setAndGet( page, `

Class Cancelled Thursday — Async Work Instead

Due to a departmental conference, class will not meet on Thursday, October 17th. Please complete the following asynchronous activities instead:

  1. Watch the recorded lecture posted in Module 5 (approximately 45 minutes)
  2. Complete the reading response in the Discussion board by Friday noon
  3. Begin working on Problem Set 4 (not due until next Tuesday)
`, ) expect(content).toContain('Class Cancelled Thursday') expect(content).toContain('asynchronous activities') expect(content).toContain('Problem Set 4') }) test('exam logistics announcement — location and time preserved', async ({page}) => { const content = await setAndGet( page, `

Midterm Exam Information

Date: Wednesday, October 23rd

Time: 7:00 PM - 9:00 PM (arrive by 6:45)

Location: Science Building, Rooms 101 and 102

What to bring:

No notes, phones, or smartwatches permitted. Review sheets are available on the course homepage.

`, ) expect(content).toContain('Science Building') expect(content).toContain('non-graphing scientific calculator') expect(content).toContain('Review sheets') }) test('guest speaker announcement with bio — text preserved', async ({page}) => { const content = await setAndGet( page, `

We have a special guest speaker joining us next Monday!

Dr. Maria Chen is a principal researcher at the National Institute of Standards and Technology. Her work focuses on quantum computing applications in cryptography.

She will discuss her recent paper Post-Quantum Cryptographic Protocols for Financial Systems and take questions from the class.

Attendance is mandatory and counts toward your participation grade.

`, ) expect(content).toContain('National Institute of Standards') expect(content).toContain('Post-Quantum Cryptographic Protocols') expect(content).toContain('participation grade') }) })