From 26a01981122bad1875307e17bbb0bee9e6e156eb Mon Sep 17 00:00:00 2001 From: koji Date: Tue, 5 Mar 2024 16:10:29 -0500 Subject: [PATCH] Update hooks.test.ts --- app/src/resources/health/__tests__/hooks.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/resources/health/__tests__/hooks.test.ts b/app/src/resources/health/__tests__/hooks.test.ts index a82183a3570..59cdc14b0dd 100644 --- a/app/src/resources/health/__tests__/hooks.test.ts +++ b/app/src/resources/health/__tests__/hooks.test.ts @@ -8,33 +8,33 @@ vi.mock('@opentrons/react-api-client') describe('useRobotInitializationStatus', () => { it('should return "INITIALIZING" when response status code is 503', () => { - vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }) => { + vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }: any) => onSuccess({ status: 503 }) - }) + ) const { result } = renderHook(() => useRobotInitializationStatus()) expect(result.current).toBe(INIT_STATUS.INITIALIZING) }) it('should return "SUCCEEDED" when response status code is 200', () => { - vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }) => { + vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }: any) => onSuccess({ status: 200 }) - }) + ) const { result } = renderHook(() => useRobotInitializationStatus()) expect(result.current).toBe(INIT_STATUS.SUCCEEDED) }) it('should return "FAILED" when response status code is 500', () => { - vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }) => { + vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }: any) => onSuccess({ status: 500 }) - }) + ) const { result } = renderHook(() => useRobotInitializationStatus()) expect(result.current).toBe(INIT_STATUS.FAILED) }) it('should return null when response status code is not 200, 500, or 503.', () => { - vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }) => { + vi.mocked(useHealthQuery).mockImplementation(({ onSuccess }: any) => onSuccess({ status: 404 }) - }) + ) const { result } = renderHook(() => useRobotInitializationStatus()) expect(result.current).toBeNull() })