diff --git a/assets/tests/hooks/usePersistedStateReducer.test.ts b/assets/tests/hooks/usePersistedStateReducer.test.ts index 9aa565c50..8fd3439f2 100644 --- a/assets/tests/hooks/usePersistedStateReducer.test.ts +++ b/assets/tests/hooks/usePersistedStateReducer.test.ts @@ -1,4 +1,4 @@ -import { act, renderHook, waitFor } from "@testing-library/react" +import { act, renderHook } from "@testing-library/react" import { putUserSetting, putRouteTabs } from "../../src/api" import appData from "../../src/appData" import usePersistedStateReducer, { @@ -339,16 +339,13 @@ describe("usePersistedStateReducer", () => { .mockImplementationOnce(() => fakePromise) .mockImplementationOnce(() => fakePromise) - act(() => { + await act(async () => { dispatch(createRouteTab()) }) - const initialValue = result.current - await waitFor(() => { - expect(result.current).not.toBe(initialValue) - }) const [state] = result.current + expect(putRouteTabs).toHaveBeenCalledTimes(3) expect(state.routeTabs).toMatchObject([ { ordering: 0, @@ -358,7 +355,6 @@ describe("usePersistedStateReducer", () => { expect(state.routeTabsToPush).toBeNull() expect(state.routeTabsToPushNext).toBeNull() expect(state.routeTabsPushInProgress).toEqual(false) - expect(putRouteTabs).toHaveBeenCalledTimes(3) }) })