import {test, expect} from '../../fixtures/test' // and are semantic elements for tracked-changes markup: // marks inserted text (displayed with underline by default) // marks deleted text (displayed with strikethrough by default) // They appear in course content that shows revisions, legal documents, or // tracked edits. canvas-rce must preserve them through round-trips. test.describe(' and tracked-change elements', () => { 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(' text is preserved', async ({page}) => { const content = await setAndGet(page, '

The answer is 42 43.

') expect(content).toContain('42') expect(content).toContain('43') }) test(' with datetime attribute — text preserved', async ({page}) => { const content = await setAndGet( page, '

New clause: all students must register

', ) expect(content).toContain('all students must register') }) test(' with cite attribute — text preserved', async ({page}) => { const content = await setAndGet( page, '

Old policy text

', ) expect(content).toContain('Old policy text') }) test(' and in a list item both preserved', async ({page}) => { const content = await setAndGet( page, '
  • Remove this step
  • Add this step
', ) expect(content).toContain('Remove this step') expect(content).toContain('Add this step') }) test(' wrapping a long passage — all text survives', async ({page}) => { const content = await setAndGet( page, '

This entire sentence has been removed from the revised document. New text here.

', ) expect(content).toContain('New text here') expect(content).toContain('removed from the revised') }) test(' inside a table cell is preserved', async ({page}) => { const content = await setAndGet( page, '
Old value New value
', ) expect(content).toContain('Old value') expect(content).toContain('New value') }) })