aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/forms/field.test.tsx
blob: 0cc8a60131bb62a829f9da1f3d4360cf54d6c28f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { render, screen } from '@tests/utils';
import Field from './field';

describe('Field', () => {
  it('renders a text input', () => {
    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
        id="search-field"
        name="search-field"
        type="search"
        value=""
        setValue={() => null}
      />
    );
    expect(screen.getByRole('searchbox')).toHaveAttribute('type', 'search');
  });
});