import { render, screen } from '@testing-library/react'; import { DotStrip } from '@/components/DotStrip'; describe('DotStrip', () => { it('enumerates anchor and school values in the aria-label', () => { render( , ); const strip = screen.getByRole('img'); expect(strip).toHaveAccessibleName( 'Reading: England 75%, Barclay 91%, Elmhurst 92%, Plumcroft 87%', ); }); it('renders the anchor tick when provided and not otherwise', () => { const { rerender } = render( , ); expect(screen.getByText('England 75%')).toBeInTheDocument(); rerender( , ); expect(screen.queryByText(/England/)).not.toBeInTheDocument(); }); it('skips schools without a value', () => { render( , ); expect(screen.getByRole('img')).toHaveAccessibleName('Maths: Barclay 91%'); }); });