Skip to content

Commit

Permalink
[ResponseOps][Cases]Fix unit tests for React@18 (elastic#207072)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgianaonoleata1904 authored Jan 22, 2025
1 parent dd37080 commit f4ff699
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,21 @@ describe('ConnectorForm', () => {
/>
);

expect(result.getByTestId('nameInput')).toBeInTheDocument();
expect(await result.findByTestId('nameInput')).toBeInTheDocument();

await act(async () => {
const submit = onChange.mock.calls[0][0].submit;
await submit();
});

await waitFor(() => expect(onChange).toHaveBeenCalled());

expect(onChange).toHaveBeenCalledWith({
isSubmitted: false,
isSubmitting: false,
isValid: false,
preSubmitValidator: expect.anything(),
submit: expect.anything(),
await waitFor(() => {
expect(onChange).toHaveBeenCalledWith({
isSubmitted: true,
isSubmitting: false,
isValid: false,
preSubmitValidator: expect.anything(),
submit: expect.anything(),
});
});
});

Expand Down

0 comments on commit f4ff699

Please sign in to comment.