diff --git a/craft/src/components/sections/ContentSlider.toHtml.test.ts b/craft/src/components/sections/ContentSlider.toHtml.test.ts index f1b1a15..d4b147d 100644 --- a/craft/src/components/sections/ContentSlider.toHtml.test.ts +++ b/craft/src/components/sections/ContentSlider.toHtml.test.ts @@ -109,6 +109,15 @@ describe('ContentSlider.toHtml renders slide.imageSrc as a background-image (INT expect(html).not.toContain('background-image:url('); expect(html).toContain('background-color:#123456'); }); + + test('a slide with a data:image/svg+xml imageSrc exports a non-empty background-image url (safeImageUrl, not safeUrl)', () => { + const svgDataUri = 'data:image/svg+xml,%3Csvg%2F%3E'; + const slidesWithSvg = [ + { type: 'image' as const, imageSrc: svgDataUri, heading: 'One' }, + ]; + const { html } = toHtml({ slides: slidesWithSvg }, ''); + expect(html).toContain(`background-image:url('${svgDataUri}')`); + }); }); describe('ContentSlider.toHtml interval is NOT runtime-type-checked -- must be coerced before it reaches the inline