aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/forms/field.test.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-01 22:46:07 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-01 22:58:23 +0200
commit2b70c89962a18f33995fcca762fed73fd5ce8f28 (patch)
tree2176c687b0e21053df9cb9bfde50d78c0a2514fc /src/components/atoms/forms/field.test.tsx
parentd177e0c7c61845b516d4a361a21739bb6486b9b5 (diff)
chore: add labelled field component
Diffstat (limited to 'src/components/atoms/forms/field.test.tsx')
-rw-r--r--src/components/atoms/forms/field.test.tsx20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/components/atoms/forms/field.test.tsx b/src/components/atoms/forms/field.test.tsx
index 5488220..a04a976 100644
--- a/src/components/atoms/forms/field.test.tsx
+++ b/src/components/atoms/forms/field.test.tsx
@@ -3,12 +3,28 @@ import Field from './field';
describe('Field', () => {
it('renders a text input', () => {
- render(<Field type="text" value="" setValue={() => null} />);
+ render(
+ <Field
+ id="text-field"
+ name="text-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} />);
+ render(
+ <Field
+ id="search-field"
+ name="search-field"
+ type="search"
+ value=""
+ setValue={() => null}
+ />
+ );
expect(screen.getByRole('searchbox')).toHaveAttribute('type', 'search');
});
});