diff --git a/packages/react-router/tests/store-updates-during-navigation.test.tsx b/packages/react-router/tests/store-updates-during-navigation.test.tsx index 2b35683ef5..9a58739274 100644 --- a/packages/react-router/tests/store-updates-during-navigation.test.tsx +++ b/packages/react-router/tests/store-updates-during-navigation.test.tsx @@ -189,7 +189,7 @@ describe("Store doesn't update *too many* times during navigation", () => { test('hover preload, then navigate, w/ async loaders', async () => { const { select } = setup({ beforeLoad: () => Promise.resolve({ foo: 'bar' }), - loader: () => Promise.resolve({ hello: 'world' }), + loader: () => resolveAfter(100, { hello: 'world' }), }) const link = await waitFor(() => @@ -197,6 +197,7 @@ describe("Store doesn't update *too many* times during navigation", () => { ) const before = select.mock.calls.length fireEvent.focus(link) + await new Promise((resolve) => setTimeout(resolve, 50)) fireEvent.click(link) const title = await waitFor(() => screen.getByRole('heading', { name: /Title$/ }), @@ -208,6 +209,6 @@ describe("Store doesn't update *too many* times during navigation", () => { // This number should be as small as possible to minimize the amount of work // that needs to be done during a navigation. // Any change that increases this number should be investigated. - expect(updates).toBe(15) + expect(updates).toBe(14) }) })