From fb860884857da73ee5b5e897745301cdf1d770a2 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 5 Oct 2023 18:58:30 +0200 Subject: refactor(components): make form components compliant with Eslint rules --- src/components/molecules/forms/switch/switch.test.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/components/molecules/forms/switch/switch.test.tsx') diff --git a/src/components/molecules/forms/switch/switch.test.tsx b/src/components/molecules/forms/switch/switch.test.tsx index 3d091cb..e2e27be 100644 --- a/src/components/molecules/forms/switch/switch.test.tsx +++ b/src/components/molecules/forms/switch/switch.test.tsx @@ -1,7 +1,7 @@ import { describe, expect, it } from '@jest/globals'; -import { render, screen } from '../../../../../tests/utils'; +import { render, screen as rtlScreen } from '@testing-library/react'; import { Legend } from '../../../atoms'; -import { Switch, SwitchOption } from './switch'; +import { Switch, type SwitchOption } from './switch'; const doNothing = () => { /* Do nothing. */ @@ -27,9 +27,9 @@ describe('Switch', () => { ); expect( - screen.getByRole('radiogroup', { name: legend }) + rtlScreen.getByRole('radiogroup', { name: legend }) ).toBeInTheDocument(); - expect(screen.getAllByRole('radio')).toHaveLength(items.length); + expect(rtlScreen.getAllByRole('radio')).toHaveLength(items.length); }); it('can render a disabled switch', () => { @@ -43,8 +43,8 @@ describe('Switch', () => { /> ); - const radios = screen.getAllByRole('radio'); + const radios = rtlScreen.getAllByRole('radio'); expect(radios.every((radio) => radio.disabled)).toBe(true); - expect(screen.getByRole('radiogroup')).toBeDisabled(); + expect(rtlScreen.getByRole('radiogroup')).toBeDisabled(); }); }); -- cgit v1.2.3