import {test, expect} from '../../fixtures/test' // Instructors build image galleries using
wrappers with multiple // images and a shared
. Course pages also use figure for // side-by-side comparison images, before/after diagrams, and annotated // screenshots. All image alt text and caption text must survive round-trips. test.describe('
with multiple images and captions', () => { 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('
with two images and caption — caption and alts preserved', async ({page}) => { const content = await setAndGet( page, '
Before treatmentAfter treatment
Figure 1: Before and after comparison.
', ) expect(content).toContain('Before treatment') expect(content).toContain('After treatment') expect(content).toContain('Before and after comparison') }) test('
gallery with three images — all alt texts preserved', async ({page}) => { const content = await setAndGet( page, '', ) expect(content).toContain('Specimen A') expect(content).toContain('Specimen B') expect(content).toContain('Specimen C') expect(content).toContain('Cell specimens') }) test('
before images — caption text preserved', async ({page}) => { const content = await setAndGet( page, '
Caption first pattern
Technical diagram
', ) expect(content).toContain('Caption first pattern') expect(content).toContain('Technical diagram') }) test('multiple
elements — all captions preserved', async ({page}) => { const content = await setAndGet( page, '
Graph A
Figure 1: Revenue
Graph B
Figure 2: Expenses
', ) expect(content).toContain('Figure 1: Revenue') expect(content).toContain('Figure 2: Expenses') }) test('
with wrapping image — link and alt preserved', async ({page}) => { const content = await setAndGet( page, '
Diagram thumbnail
Click to view full diagram.
', ) expect(content).toContain('Diagram thumbnail') expect(content).toContain('Click to view full diagram') }) })