import { describe, test, expect } from 'vitest'; import { ContentSlider } from './ContentSlider'; const toHtml = (ContentSlider as any).toHtml; const slides = [ { type: 'image' as const, heading: 'One' }, { type: 'image' as const, heading: 'Two' }, { type: 'image' as const, heading: 'Three' }, ]; describe('ContentSlider.toHtml accessibility (F1.1)', () => { test('prev/next arrows get aria-labels and are real buttons', () => { const { html } = toHtml({ slides, showArrows: true }, ''); expect(html).toMatch(/]*aria-label="Previous slide"/); expect(html).toMatch(/]*aria-label="Next slide"/); }); test('dot buttons get "Go to slide N" aria-labels', () => { const { html } = toHtml({ slides, showDots: true }, ''); expect(html).toMatch(/]*aria-label="Go to slide 1"/); expect(html).toMatch(/]*aria-label="Go to slide 2"/); expect(html).toMatch(/]*aria-label="Go to slide 3"/); }); test('slides are wrapped in an aria-live region', () => { const { html } = toHtml({ slides }, ''); expect(html).toMatch(/aria-live="(polite|off)"/); }); test('decorative chevron icons in arrows are aria-hidden', () => { const { html } = toHtml({ slides, showArrows: true }, ''); expect(html).toMatch(/