import {test, expect} from '../../fixtures/test' // Deeply nested inline elements appear when instructors layer formatting: // bold italic underlined text, colored bold text, etc. TinyMCE must preserve // all the formatting layers and the inner text through serialization. test.describe('deeply nested inline formatting combinations', () => { 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(' nesting — text preserved', async ({page}) => { const content = await setAndGet(page, '

Bold italic text

') expect(content).toContain('Bold italic text') }) test(' three levels — text preserved', async ({page}) => { const content = await setAndGet( page, '

Triple formatted

', ) expect(content).toContain('Triple formatted') }) test(' color wrapping — text preserved', async ({page}) => { const content = await setAndGet( page, '

Red bold text

', ) expect(content).toContain('Red bold text') }) test(' inside — superscript bold preserved', async ({page}) => { const content = await setAndGet( page, '

E = mc2 (energy equation)

', ) expect(content).toContain('energy equation') }) test(' inside — code bold preserved', async ({page}) => { const content = await setAndGet( page, '

Use console.log() for debugging.

', ) expect(content).toContain('console.log()') expect(content).toContain('debugging') }) test('mixed inline siblings — all text preserved', async ({page}) => { const content = await setAndGet( page, '

Bold, italic, underline, and code in one paragraph.

', ) expect(content).toContain('Bold') expect(content).toContain('italic') expect(content).toContain('underline') expect(content).toContain('code') }) test('4-level nesting: em > strong > span > code', async ({page}) => { const content = await setAndGet( page, '

deep

', ) expect(content).toContain('deep') }) test(' inside — marked link text preserved', async ({page}) => { const content = await setAndGet( page, '

Introduction

', ) expect(content).toContain('Introduction') }) })