From 3edd32e0d4f50469746b7b7ea7a85945909040e0 Mon Sep 17 00:00:00 2001 From: smb2268 Date: Thu, 15 Feb 2024 16:52:46 -0500 Subject: [PATCH] Fix tests --- .../PipetteCard/__tests__/PipetteCard.test.tsx | 18 +++--------------- .../GripperCard/__tests__/GripperCard.test.tsx | 12 +++--------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/app/src/organisms/Devices/PipetteCard/__tests__/PipetteCard.test.tsx b/app/src/organisms/Devices/PipetteCard/__tests__/PipetteCard.test.tsx index c3d1d24153d..b6da76bbbb2 100644 --- a/app/src/organisms/Devices/PipetteCard/__tests__/PipetteCard.test.tsx +++ b/app/src/organisms/Devices/PipetteCard/__tests__/PipetteCard.test.tsx @@ -87,7 +87,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -132,7 +131,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -149,7 +147,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: true, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -172,7 +169,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: true, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: true, } @@ -194,7 +190,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -210,7 +205,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -226,7 +220,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -243,7 +236,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -259,7 +251,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -274,7 +265,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: false, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -298,16 +288,15 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: true, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } render(props) screen.getByText('Right mount') screen.getByText('Instrument attached') - screen.getByText('Firmware update available.') - fireEvent.click(screen.getByText('Update now')) - expect(props.updatePipette).toHaveBeenCalled() + screen.getByText( + `Instrument firmware update needed. Start the update on the robot's touchscreen.` + ) }) it('renders firmware update in progress state if pipette is bad and update in progress', () => { when(mockUseCurrentSubsystemUpdateQuery).mockReturnValue({ @@ -320,7 +309,6 @@ describe('PipetteCard', () => { pipetteIs96Channel: false, isPipetteCalibrated: false, pipetteIsBad: true, - updatePipette: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } diff --git a/app/src/organisms/GripperCard/__tests__/GripperCard.test.tsx b/app/src/organisms/GripperCard/__tests__/GripperCard.test.tsx index 69710a22d0e..e6c0d671a9e 100644 --- a/app/src/organisms/GripperCard/__tests__/GripperCard.test.tsx +++ b/app/src/organisms/GripperCard/__tests__/GripperCard.test.tsx @@ -45,7 +45,6 @@ describe('GripperCard', () => { }, } as GripperData, isCalibrated: true, - setSubsystemToUpdate: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -88,7 +87,6 @@ describe('GripperCard', () => { }, } as GripperData, isCalibrated: false, - setSubsystemToUpdate: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -112,7 +110,6 @@ describe('GripperCard', () => { }, } as GripperData, isCalibrated: false, - setSubsystemToUpdate: jest.fn(), isRunActive: false, isEstopNotDisengaged: true, } @@ -156,7 +153,6 @@ describe('GripperCard', () => { props = { attachedGripper: null, isCalibrated: false, - setSubsystemToUpdate: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } @@ -175,16 +171,15 @@ describe('GripperCard', () => { ok: false, } as any, isCalibrated: false, - setSubsystemToUpdate: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, } render(props) screen.getByText('Extension mount') screen.getByText('Instrument attached') - screen.getByText('Firmware update available.') - fireEvent.click(screen.getByText('Update now')) - expect(props.setSubsystemToUpdate).toHaveBeenCalledWith('gripper') + screen.getByText( + `Instrument firmware update needed. Start the update on the robot's touchscreen.` + ) }) it('renders firmware update in progress state if gripper is bad and update in progress', () => { mockUseCurrentSubsystemUpdateQuery.mockReturnValue({ @@ -195,7 +190,6 @@ describe('GripperCard', () => { ok: false, } as any, isCalibrated: true, - setSubsystemToUpdate: jest.fn(), isRunActive: false, isEstopNotDisengaged: false, }