Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing test to pass with node 18
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
amitgalitz committed May 24, 2023
1 parent 710e3c4 commit 09d38a1
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -29,11 +29,14 @@ describe('<NameAndDescription /> spec', () => {
expect(container.firstChild).toMatchSnapshot();
});
test('shows error for detector name input when toggling focus/blur', async () => {
const handleValidateName = jest.fn().mockImplementation(() => {
throw 'Required';
const handleValidateName = jest.fn().mockImplementationOnce(() => {
return 'Required';
});
const { queryByText, findByText, getByPlaceholderText } = render(
<Formik initialValues={{ name: '' }} onSubmit={jest.fn()}>
<Formik
initialValues={{ name: '', description: 'one' }}
onSubmit={jest.fn()}
>
{() => (
<div>
<NameAndDescription onValidateDetectorName={handleValidateName} />
@@ -49,6 +52,7 @@ describe('<NameAndDescription /> spec', () => {
expect(handleValidateName).toHaveBeenCalledTimes(1);
expect(findByText('Required')).not.toBeNull();
});

test('shows error for detector description input when toggling focus/bur', async () => {
const { queryByText, findByText, getByPlaceholderText } = render(
<Formik

0 comments on commit 09d38a1

Please sign in to comment.