import {test, expect} from '../../fixtures/test' // Schema.org microdata attributes (itemscope, itemtype, itemprop) appear in // course content copied from external educational resources or generated by // content management tools. They add semantic meaning for search engines // without changing visual rendering — but must survive round-trips. test.describe('Schema.org microdata attributes (itemscope/itemprop)', () => { 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('itemscope/itemtype on div — text preserved', async ({page}) => { const content = await setAndGet( page, '

Introduction to Algorithms

A foundational course on algorithm design.

', ) expect(content).toContain('Introduction to Algorithms') expect(content).toContain('A foundational course on algorithm design') }) test('itemprop on multiple elements — all text preserved', async ({page}) => { const content = await setAndGet( page, '
Dr. Jane Smith, Professor of Computer Science
', ) expect(content).toContain('Dr. Jane Smith') expect(content).toContain('Professor of Computer Science') }) test('nested itemscope — all text preserved', async ({page}) => { const content = await setAndGet( page, '
State University
Department of Physics
', ) expect(content).toContain('State University') expect(content).toContain('Department of Physics') }) test('itemprop on a link — link text preserved', async ({page}) => { const content = await setAndGet( page, '
', ) expect(content).toContain('Understanding Recursion') }) })