import {test, expect} from '../../fixtures/test' // is the semantic inline quotation element — browsers render it with // quotation marks automatically. The cite attribute points to the source URL. // canvas-rce should preserve and its content for accessible course material. test.describe('inline quotation element', () => { 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(' element text is preserved', async ({page}) => { const content = await setAndGet( page, '

Einstein said Imagination is more important than knowledge.

', ) expect(content).toContain('Imagination is more important than knowledge') expect(content).toContain('Einstein said') }) test(' with cite attribute is handled', async ({page}) => { const content = await setAndGet( page, '

As stated in the original text.

', ) expect(content).toContain('the original text') expect(content).toContain('As stated in') }) test('nested elements preserve both quotation levels', async ({page}) => { const content = await setAndGet( page, '

She said He told me come back tomorrow yesterday.

', ) expect(content).toContain('come back tomorrow') expect(content).toContain('yesterday') }) test(' inside a list item is preserved', async ({page}) => { const content = await setAndGet( page, '
  • Remember: less is more
  • Also: keep it simple
', ) expect(content).toContain('less is more') expect(content).toContain('keep it simple') }) test(' with formatted text inside is preserved', async ({page}) => { const content = await setAndGet( page, '

The key insight is that simplicity wins.

', ) expect(content).toContain('The key insight') expect(content).toContain('simplicity wins') expect(content).toMatch(//) }) })