import {test, expect} from '../../fixtures/test' // Rubric tables describe grading criteria with performance levels. // Canvas stores rubric descriptions as HTML in the RCE. A complex rubric // table with headers, colspan, and detailed cell text exercises many // table serialization code paths simultaneously. test.describe('rubric-style grading tables', () => { 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 rubric with criteria and performance levels', async ({page}) => { const content = await setAndGet( page, `
Criteria Excellent (4) Proficient (3) Developing (2) Beginning (1)
Code Quality Clean, well-commented, follows style guide Readable with minor issues Some logic issues Hard to read
Correctness All tests pass Most tests pass Some tests fail Many failures
`, ) expect(content).toContain('Criteria') expect(content).toContain('Excellent (4)') expect(content).toContain('Code Quality') expect(content).toContain('Clean, well-commented') expect(content).toContain('Correctness') expect(content).toContain('All tests pass') }) test('rubric with point values in header — all preserved', async ({page}) => { const content = await setAndGet( page, `
Essay Rubric — 100 points total
CategoryPointsDescription
Thesis20Clear central argument stated in introduction
Evidence30Three or more supporting examples with citations
Analysis30Connects evidence to thesis effectively
Writing20Grammar, mechanics, and style
`, ) expect(content).toContain('Essay Rubric') expect(content).toContain('Thesis') expect(content).toContain('20') expect(content).toContain('Clear central argument') expect(content).toContain('citations') }) })