diff --git a/app/src/organisms/ErrorRecoveryFlows/hooks/__tests__/useHomeGripperZAxis.test.ts b/app/src/organisms/ErrorRecoveryFlows/hooks/__tests__/useHomeGripperZAxis.test.ts index c640f448d6c..32f5d939eb8 100644 --- a/app/src/organisms/ErrorRecoveryFlows/hooks/__tests__/useHomeGripperZAxis.test.ts +++ b/app/src/organisms/ErrorRecoveryFlows/hooks/__tests__/useHomeGripperZAxis.test.ts @@ -6,7 +6,9 @@ import { RECOVERY_MAP } from '/app/organisms/ErrorRecoveryFlows/constants' describe('useHomeGripper', () => { const mockRecoveryCommands = { - homeGripper: vi.fn().mockResolvedValue(undefined), + updatePositionEstimatorsAndHomeGripper: vi + .fn() + .mockResolvedValue(undefined), } const mockRouteUpdateActions = { @@ -43,7 +45,9 @@ describe('useHomeGripper', () => { expect(mockRouteUpdateActions.handleMotionRouting).toHaveBeenCalledWith( true ) - expect(mockRecoveryCommands.homeGripper).toHaveBeenCalled() + expect( + mockRecoveryCommands.updatePositionEstimatorsAndHomeGripper + ).toHaveBeenCalled() expect(mockRouteUpdateActions.handleMotionRouting).toHaveBeenCalledWith( false ) @@ -60,7 +64,9 @@ describe('useHomeGripper', () => { }) expect(mockRouteUpdateActions.goBackPrevStep).toHaveBeenCalled() - expect(mockRecoveryCommands.homeGripper).not.toHaveBeenCalled() + expect( + mockRecoveryCommands.updatePositionEstimatorsAndHomeGripper + ).not.toHaveBeenCalled() }) it('should not home again if already homed once', async () => { @@ -77,11 +83,15 @@ describe('useHomeGripper', () => { await new Promise(resolve => setTimeout(resolve, 0)) }) - expect(mockRecoveryCommands.homeGripper).toHaveBeenCalledTimes(1) + expect( + mockRecoveryCommands.updatePositionEstimatorsAndHomeGripper + ).toHaveBeenCalledTimes(1) rerender() - expect(mockRecoveryCommands.homeGripper).toHaveBeenCalledTimes(1) + expect( + mockRecoveryCommands.updatePositionEstimatorsAndHomeGripper + ).toHaveBeenCalledTimes(1) }) it('should reset hasHomedOnce when step changes to non-manual gripper step and back', async () => { @@ -103,7 +113,9 @@ describe('useHomeGripper', () => { await new Promise(resolve => setTimeout(resolve, 0)) }) - expect(mockRecoveryCommands.homeGripper).toHaveBeenCalledTimes(1) + expect( + mockRecoveryCommands.updatePositionEstimatorsAndHomeGripper + ).toHaveBeenCalledTimes(1) rerender({ recoveryMap: { step: 'SOME_OTHER_STEP' } as any }) @@ -117,6 +129,8 @@ describe('useHomeGripper', () => { await new Promise(resolve => setTimeout(resolve, 0)) }) - expect(mockRecoveryCommands.homeGripper).toHaveBeenCalledTimes(2) + expect( + mockRecoveryCommands.updatePositionEstimatorsAndHomeGripper + ).toHaveBeenCalledTimes(2) }) })