import {test, expect} from '../../fixtures/test' //
insideappears in quoted code samples and technical // documentation. This combination is common in CS course pages that quote // code from a reference and show it pre-formatted. Both elements must // preserve their structural semantics and text content. test.describe('inside', () => { 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(' inside— code text preserved', async ({page}) => { const content = await setAndGet( page, '', ) expect(content).toContain('From the docs') expect(content).toContain('const result') expect(content).toContain('return result') }) test('From the docs:
const result = compute();\nreturn result;inside— text preserved', async ({page}) => { const content = await setAndGet( page, '', ) expect(content).toContain('def hello') expect(content).toContain('print') expect(content).toContain('world') }) test('paragraph anddef hello():\n print("world")siblings in— both preserved', async ({page}) => { const content = await setAndGet( page, '', ) expect(content).toContain('Usage example') expect(content).toContain('command --flag value') expect(content).toContain('Output above') }) test('Usage example:
$ command --flag valueOutput above.
withand a cite attribute — text preserved', async ({page}) => { const content = await setAndGet( page, 'sample.code()Source linked.
', ) expect(content).toContain('sample.code') expect(content).toContain('Source linked') }) })