Skip to content

Commit

Permalink
fix warning in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic committed Oct 27, 2022
1 parent c2c43d7 commit aa53370
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ describe('useTourContext', () => {
});
expect(result.current.isTourShown(stepId)).toBe(true);
});
it('endTourStep calls completeGuideStep with correct stepId', () => {
const { result } = renderHook(() => useTourContext(), {
wrapper: TourContextProvider,
it('endTourStep calls completeGuideStep with correct stepId', async () => {
await act(async () => {
const { result, waitForNextUpdate } = renderHook(() => useTourContext(), {
wrapper: TourContextProvider,
});
await waitForNextUpdate();
result.current.endTourStep(stepId);
expect(mockCompleteGuideStep).toHaveBeenCalledWith('security', stepId);
});
result.current.endTourStep(stepId);
expect(mockCompleteGuideStep).toHaveBeenCalledWith('security', stepId);
});
it('activeStep is initially 1', () => {
const { result } = renderHook(() => useTourContext(), {
Expand Down

0 comments on commit aa53370

Please sign in to comment.