diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-03-31 17:57:39 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-03-31 17:57:39 +0200 |
| commit | b145ed4492de834f5cea9437e9772c4f7fbe90ec (patch) | |
| tree | 76a0b99d5106bc30719bba9e7f13ba30f42e9d8c /src/components/atoms/forms/field.test.tsx | |
| parent | 8370602f37ad6aa02485d85e5b179b76c3f15701 (diff) | |
chore: add a Field component
Diffstat (limited to 'src/components/atoms/forms/field.test.tsx')
| -rw-r--r-- | src/components/atoms/forms/field.test.tsx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/atoms/forms/field.test.tsx b/src/components/atoms/forms/field.test.tsx new file mode 100644 index 0000000..5488220 --- /dev/null +++ b/src/components/atoms/forms/field.test.tsx @@ -0,0 +1,14 @@ +import { render, screen } from '@test-utils'; +import Field from './field'; + +describe('Field', () => { + it('renders a text input', () => { + render(<Field type="text" value="" setValue={() => null} />); + expect(screen.getByRole('textbox')).toHaveAttribute('type', 'text'); + }); + + it('renders a search input', () => { + render(<Field type="search" value="" setValue={() => null} />); + expect(screen.getByRole('searchbox')).toHaveAttribute('type', 'search'); + }); +}); |
