import {test, expect} from '../../fixtures/test' // Typographic and bidirectional control elements: // - : word break opportunity — a hint to break a long word at this point // - : bidirectional isolation — isolates text whose direction is unknown // - : bidirectional override — forces a specific text direction // These appear in multilingual courses and formatted technical content. test.describe(', , and elements', () => { 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(' in a long URL — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Visit: https://www.university.edu/courses/advanced-topics

', ) expect(content).toContain('courses') expect(content).toContain('advanced-topics') }) test(' isolates username text — text preserved', async ({page}) => { const content = await setAndGet(page, '

Posted by: أحمد (Ahmed)

') expect(content).toContain('أحمد') expect(content).toContain('Ahmed') }) test(' reverses text direction — text preserved', async ({page}) => { const content = await setAndGet(page, '

Reversed: ABCDE

') expect(content).toContain('ABCDE') expect(content).toContain('Reversed') }) test(' forces ltr in rtl context — text preserved', async ({page}) => { const content = await setAndGet( page, '

النص: LTR text forced

', ) expect(content).toContain('النص') expect(content).toContain('LTR text forced') }) test('multiple spans in a leaderboard — all text preserved', async ({page}) => { const content = await setAndGet( page, '
  1. Alice: 95
  2. محمد: 92
  3. 田中: 88
', ) expect(content).toContain('Alice') expect(content).toContain('محمد') expect(content).toContain('田中') }) })