import {test, expect} from '../../fixtures/test' // (Word Break Opportunity) hints where long strings may wrap — used for // long URLs displayed as text, CamelCase identifiers, and compound words in // narrow table cells. Unlike ­ (soft hyphen), inserts no hyphen. // The element is void and its presence affects layout without altering text. test.describe(' word break opportunity 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 long URL — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Documentation: https://docs.example.com/courses/api/v3/endpoints

', ) expect(content).toContain('Documentation') expect(content).toContain('docs.example.com') }) test(' in camelCase identifier — text preserved', async ({page}) => { const content = await setAndGet( page, '

Use the getDataFromRemoteServer() method.

', ) expect(content).toContain('getData') expect(content).toContain('method') }) test('multiple in narrow table cell — cell text preserved', async ({page}) => { const content = await setAndGet( page, '
Method NameprocessInputDataStream()
', ) expect(content).toContain('Method Name') expect(content).toContain('process') expect(content).toContain('Stream') }) test(' adjacent to punctuation — surrounding text preserved', async ({page}) => { const content = await setAndGet( page, '

Compound-word-example with breaks at hyphens.

', ) expect(content).toContain('with breaks at hyphens') }) })