Skip to content

Commit

Permalink
fix test 25
Browse files Browse the repository at this point in the history
  • Loading branch information
Quanmuito committed Jan 28, 2024
1 parent cf849b8 commit 0df63f6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ test.each(deliveryCases)(
const orderTimeInput = await screen.findByLabelText(/order time/i);
fireEvent.change(orderTimeInput, { target: { value: dt } });

act(() => {
fireEvent.click(screen.getByText(/calculate delivery price/i));
return new Promise<boolean>((resolve) => setTimeout(resolve, 1000));
});
act(() => fireEvent.click(screen.getByText(/calculate delivery price/i)));
new Promise<boolean>((resolve) => setTimeout(resolve, 1000));
const result = await screen.findByTestId('fee');
expect(result).toHaveTextContent(expected);
}
Expand Down

0 comments on commit 0df63f6

Please sign in to comment.