diff --git a/src/components/MaskedSecureInput/MaskedSecureInput.test.tsx b/src/components/MaskedSecureInput/MaskedSecureInput.test.tsx index dfabda2..4d149db 100644 --- a/src/components/MaskedSecureInput/MaskedSecureInput.test.tsx +++ b/src/components/MaskedSecureInput/MaskedSecureInput.test.tsx @@ -9,6 +9,7 @@ import MaskedSecureInput from './MaskedSecureInput'; describe('', () => { it('should render', async () => { render(); + const element = screen.getByLabelText('Label'); expect(element).toBeInTheDocument(); expect(element).toBeVisible(); @@ -16,6 +17,7 @@ describe('', () => { it('should toggle the visiblity of the value when blurred and focused', async () => { render(); + const element = screen.getByLabelText('Label'); await userEvent.type(element, '123456789'); await userEvent.click(document.body); @@ -27,6 +29,7 @@ describe('', () => { it('should output the unformatted value on change', async () => { const onChange = vi.fn(); render(); + const element = screen.getByLabelText('Label'); await userEvent.type(element, '123456789'); expect(element).toHaveValue('123-45-6789'); @@ -58,6 +61,7 @@ describe('', () => { it('should have inter-op with useForm()', async () => { const onSubmit = vi.fn(); render(); + const element = screen.getByLabelText('Label'); await userEvent.type(element, '123456789'); await userEvent.click(screen.getByText('Submit'));