import {test, expect} from '../../fixtures/test' // and create client-side image maps where different regions of // an image link to different URLs. They appear in legacy course content with // interactive diagrams (anatomy maps, geography maps, flowcharts). // The image alt text and any surrounding content must always survive. test.describe(' and image map 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('paragraph around image map is preserved', async ({page}) => { const content = await setAndGet( page, '

Click regions:

Interactive diagramRegion 1

See details below.

', ) expect(content).toContain('Click regions') expect(content).toContain('See details below') }) test('image with usemap — alt text preserved', async ({page}) => { const content = await setAndGet( page, 'World map with clickable regionsEurope', ) expect(content).toContain('alt') }) test(' with multiple elements — no crash', async ({page}) => { const content = await setAndGet( page, 'Human body diagramHeadTorsoLegs

Click to learn more.

', ) expect(content).toContain('Click to learn more') expect(typeof content).toBe('string') }) test('text before and after block is preserved', async ({page}) => { const content = await setAndGet( page, '

Anatomy Reference

Anatomy

Study guide continues here.

', ) expect(content).toContain('Anatomy Reference') expect(content).toContain('Study guide continues here') }) })