test(dashboard): the pair-change test stubs fetch with its own mock instead of a promise-returning mockImplementation

This commit is contained in:
Maurice
2026-11-08 20:10:22 +01:00
parent 1400b5d308
commit 1866dca818
@@ -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));