diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-05 18:58:30 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | fb860884857da73ee5b5e897745301cdf1d770a2 (patch) | |
| tree | 3aaf3c192b3375a7e1bf2dbf9daa866be357a2f5 /src/components/atoms/forms/fields/checkbox | |
| parent | e97325a2c174a87c29593d1b42b9a1cc1eaf11af (diff) | |
refactor(components): make form components compliant with Eslint rules
Diffstat (limited to 'src/components/atoms/forms/fields/checkbox')
| -rw-r--r-- | src/components/atoms/forms/fields/checkbox/checkbox.test.tsx | 6 | ||||
| -rw-r--r-- | src/components/atoms/forms/fields/checkbox/checkbox.tsx | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/components/atoms/forms/fields/checkbox/checkbox.test.tsx b/src/components/atoms/forms/fields/checkbox/checkbox.test.tsx index 59f9a4b..75fff77 100644 --- a/src/components/atoms/forms/fields/checkbox/checkbox.test.tsx +++ b/src/components/atoms/forms/fields/checkbox/checkbox.test.tsx @@ -1,5 +1,5 @@ import { describe, expect, it } from '@jest/globals'; -import { render, screen } from '../../../../../../tests/utils'; +import { render, screen as rtlScreen } from '@testing-library/react'; import { Checkbox } from './checkbox'; const doNothing = () => { @@ -16,7 +16,7 @@ describe('Checkbox', () => { value="checkbox" /> ); - expect(screen.getByRole('checkbox')).not.toBeChecked(); + expect(rtlScreen.getByRole('checkbox')).not.toBeChecked(); }); it('renders a checked checkbox', () => { @@ -29,6 +29,6 @@ describe('Checkbox', () => { value="checkbox" /> ); - expect(screen.getByRole('checkbox')).toBeChecked(); + expect(rtlScreen.getByRole('checkbox')).toBeChecked(); }); }); diff --git a/src/components/atoms/forms/fields/checkbox/checkbox.tsx b/src/components/atoms/forms/fields/checkbox/checkbox.tsx index 2ac3809..9c175b7 100644 --- a/src/components/atoms/forms/fields/checkbox/checkbox.tsx +++ b/src/components/atoms/forms/fields/checkbox/checkbox.tsx @@ -1,5 +1,5 @@ -import { FC } from 'react'; -import { BooleanField, BooleanFieldProps } from '../boolean-field'; +import type { FC } from 'react'; +import { BooleanField, type BooleanFieldProps } from '../boolean-field'; export type CheckboxProps = Omit<BooleanFieldProps, 'type'>; @@ -9,5 +9,6 @@ export type CheckboxProps = Omit<BooleanFieldProps, 'type'>; * Render a checkbox input type. */ export const Checkbox: FC<CheckboxProps> = (props) => ( + // eslint-disable-next-line react/jsx-no-literals -- Type allowed <BooleanField {...props} type="checkbox" /> ); |
