import {test, expect} from '../../fixtures/test' // Canvas ePortfolio lets students curate and showcase their work across courses. // Portfolio pages combine project descriptions, embedded media, reflection // paragraphs, skill lists, and links to artifacts. These realistic portfolio // patterns verify complex student-authored rich content survives the RCE. test.describe('Canvas ePortfolio 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('project showcase with image and description — all content preserved', async ({page}) => { const content = await setAndGet( page, `

Capstone Project: Urban Heat Island Analysis

Heat map of downtown Portland showing temperature variation
Figure 1: Surface temperature variation across Portland, OR (July 2023)

This project analyzed surface temperature data from LANDSAT-8 imagery to quantify the urban heat island effect in Portland. Using Python and GDAL, I processed 12 scenes spanning summer 2023.

Key finding: Downtown temperatures averaged 4.2°C higher than suburban parks during peak afternoon hours.

`, ) expect(content).toContain('Urban Heat Island Analysis') expect(content).toContain('temperature variation') expect(content).toContain('LANDSAT-8 imagery') expect(content).toContain('suburban parks') }) test('skills and competencies list — all items preserved', async ({page}) => { const content = await setAndGet( page, `

Technical Skills

`, ) expect(content).toContain('scikit-learn') expect(content).toContain('PostGIS') expect(content).toContain('Visualization') }) test('reflection essay with course connections — text preserved', async ({page}) => { const content = await setAndGet( page, `

Learning Reflection

Before taking STAT 301, I treated statistics as a collection of formulas to memorize. This course fundamentally changed how I think about uncertainty and inference.

The most transformative experience was the semester-long project where we designed our own study, collected data, and defended our methodology to a panel of faculty. This mirrors the peer-review process in academic research.

Going forward, I intend to apply Bayesian reasoning to my senior thesis on climate modeling.

`, ) expect(content).toContain('STAT 301') expect(content).toContain('peer-review process') expect(content).toContain('Bayesian reasoning') }) test('artifact links with context — link text preserved', async ({page}) => { const content = await setAndGet( page, `

Work Samples

  1. Genomics Literature Review — BIOL 420, Spring 2024
  2. Cell Culture Lab Notebook — BIOL 310, Fall 2023
  3. Conference Poster: CRISPR Applications — Presented at UROP Symposium
`, ) expect(content).toContain('Genomics Literature Review') expect(content).toContain('Cell Culture Lab Notebook') expect(content).toContain('CRISPR Applications') expect(content).toContain('UROP Symposium') }) })