IIIF-Studio / frontend /src /components /retro /__tests__ /RetroSelect.test.tsx
Claude
test(frontend): Sprint 5 — Vitest setup, 14 component/API tests, Viewer memo
cf9842a unverified
Raw
History Blame Contribute Delete
651 Bytes
import { render, screen } from '@testing-library/react'
import { RetroSelect } from '../index'
test('select has accessible label', () => {
render(
<RetroSelect
label="Profil"
options={[{ value: 'a', label: 'Option A' }]}
value="a"
onChange={() => {}}
/>
)
expect(screen.getByLabelText('Profil')).toBeInTheDocument()
})
test('renders all options', () => {
render(
<RetroSelect
label="Test"
options={[
{ value: 'a', label: 'A' },
{ value: 'b', label: 'B' },
]}
value="a"
onChange={() => {}}
/>
)
expect(screen.getAllByRole('option')).toHaveLength(2)
})