From 1866dca818adaf980f814c678c20b43f215fda29 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 8 Nov 2026 20:10:22 +0100 Subject: [PATCH] test(dashboard): the pair-change test stubs fetch with its own mock instead of a promise-returning mockImplementation --- client/src/components/Dashboard/useCurrencyConverter.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/Dashboard/useCurrencyConverter.test.ts b/client/src/components/Dashboard/useCurrencyConverter.test.ts index b867b67f9..abe7897c9 100644 --- a/client/src/components/Dashboard/useCurrencyConverter.test.ts +++ b/client/src/components/Dashboard/useCurrencyConverter.test.ts @@ -147,9 +147,10 @@ describe('useCurrencyConverter', () => { }); it('FE-COMP-FXHOOK-010: #3009 never prices a new pair with the previous base and says it is still loading', async () => { - fetchMock.mockImplementation((url: string) => + fetchMock = vi.fn((url: string) => respond(url.endsWith('base=JPY') ? [{ quote: 'EUR', rate: 0.0056 }] : [{ quote: 'USD', rate: 1.1 }]) ); + vi.stubGlobal('fetch', fetchMock); const { result } = renderHook(() => useCurrencyConverter()); await waitFor(() => expect(result.current.rate).toBe(1.1));