import {test, expect} from '../../fixtures/test' // marks the defining instance of a term. Used in course glossaries, // textbook content, and reference materials. Often paired with for // acronym definitions, or wrapped in

with additional explanatory text. test.describe(' definition term 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(' term in paragraph — text preserved', async ({page}) => { const content = await setAndGet( page, '

Algorithm is a step-by-step procedure for solving a problem.

', ) expect(content).toContain('Algorithm') expect(content).toContain('step-by-step procedure') }) test(' with abbreviation — text preserved', async ({page}) => { const content = await setAndGet( page, '

HTML is the language of the web.

', ) expect(content).toContain('HTML') expect(content).toContain('language of the web') }) test(' inside
in definition list — term preserved', async ({page}) => { const content = await setAndGet( page, '
Recursion
A function that calls itself.
', ) expect(content).toContain('Recursion') expect(content).toContain('A function that calls itself') }) test('multiple elements — all terms preserved', async ({page}) => { const content = await setAndGet( page, '

Key terms: Array, Stack, and Queue.

', ) expect(content).toContain('Array') expect(content).toContain('Stack') expect(content).toContain('Queue') }) test(' inside — text preserved', async ({page}) => { const content = await setAndGet( page, '

The API defines how software communicates.

', ) expect(content).toContain('API') expect(content).toContain('communicates') }) })