import React from 'react'; import { render, screen } from '@testing-library/react'; import { Input } from '../Input'; import { Select } from '../Select'; import { TextArea } from '../TextArea'; import { FormField } from './'; import { OptionGroup } from '../OptionGroup'; import { GrapesProvider } from '../GrapesProvider/GrapesProvider'; import { LOCALES } from '../GrapesProvider/exampleLocales'; describe('FormField component', () => { const value = 'abc'; const onChange = vi.fn(); describe('given default props', () => { it('has a label and an input as child', () => { render( , ); expect(screen.getByRole('textbox', { name: 'A label' })).toBeVisible(); expect( screen.getByRole('textbox', { name: 'A label' }), ).toHaveAccessibleDescription('An optional description'); }); it('has a label and a select as child', () => { render(