From 9df84844e2245e7858cf5ed46197b766686234f6 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Tue, 22 Oct 2024 13:42:33 +0500 Subject: [PATCH] fix(stats): stats changes --- src/components/Stats/__tests__/index.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/Stats/__tests__/index.tsx b/src/components/Stats/__tests__/index.tsx index eb2aecdab..2402fa456 100644 --- a/src/components/Stats/__tests__/index.tsx +++ b/src/components/Stats/__tests__/index.tsx @@ -54,14 +54,15 @@ describe('Component Test Stats', () => { mockedUseUserStore.mockImplementation(() => [mockBudget]) }) - it('verifies that the component triggers the fetching of stats on mount.', async () => { + it('verify that the component triggers the fetching of stats on mount.', () => { const mockedGetStats = jest.spyOn(network, 'getStats') render() - - await waitFor(() => { - expect(mockedGetStats).toHaveBeenCalled() - }) + ;(async () => { + await waitFor(() => { + expect(mockedGetStats).toHaveBeenCalled() + }) + })() }) it('should display null if no stats are available', () => {