import React from 'react' import { render } from '@testing-library/react' import { RadioGroup } from './RadioGroup' describe('', () => { describe('presentational', () => { it('renders a title', () => { const title = 'Label' const { queryByText } = render() expect(queryByText(title)).toBeTruthy() }) }) describe('accessibilty', () => { it('has an accessible name when not provided a labelId', () => { const { getByRole } = render() expect(getByRole('radiogroup', { name: 'Label title' })).toBeInTheDocument() }) it('has an accessible name when provided a labelId', () => { const { getByRole } = render() expect(getByRole('radiogroup', { name: 'Label title' })).toBeInTheDocument() }) }) })