|
- import {render, screen} from '@testing-library/react'
- import TextInput from '.'
-
- describe('single-line text input component', () => {
- it('should contain a text input element', () => {
- render(<TextInput label="" name="" />)
- expect(screen.getByRole('textbox')).toBeInTheDocument()
- })
-
- it('should acquire a descriptive label', () => {
- const label = 'foo'
- render(<TextInput label={label} name="" />)
- expect(screen.getByLabelText(label)).toBeInTheDocument()
- })
- })
|