Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smb2268 committed Feb 15, 2024
1 parent dc5f48a commit 3edd32e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand Down Expand Up @@ -132,7 +131,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -149,7 +147,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: true,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -172,7 +169,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: true,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: true,
}
Expand All @@ -194,7 +190,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -210,7 +205,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -226,7 +220,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -243,7 +236,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -259,7 +251,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -274,7 +265,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: false,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -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({
Expand All @@ -320,7 +309,6 @@ describe('PipetteCard', () => {
pipetteIs96Channel: false,
isPipetteCalibrated: false,
pipetteIsBad: true,
updatePipette: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand Down
12 changes: 3 additions & 9 deletions app/src/organisms/GripperCard/__tests__/GripperCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ describe('GripperCard', () => {
},
} as GripperData,
isCalibrated: true,
setSubsystemToUpdate: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand Down Expand Up @@ -88,7 +87,6 @@ describe('GripperCard', () => {
},
} as GripperData,
isCalibrated: false,
setSubsystemToUpdate: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -112,7 +110,6 @@ describe('GripperCard', () => {
},
} as GripperData,
isCalibrated: false,
setSubsystemToUpdate: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: true,
}
Expand Down Expand Up @@ -156,7 +153,6 @@ describe('GripperCard', () => {
props = {
attachedGripper: null,
isCalibrated: false,
setSubsystemToUpdate: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand All @@ -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({
Expand All @@ -195,7 +190,6 @@ describe('GripperCard', () => {
ok: false,
} as any,
isCalibrated: true,
setSubsystemToUpdate: jest.fn(),
isRunActive: false,
isEstopNotDisengaged: false,
}
Expand Down

0 comments on commit 3edd32e

Please sign in to comment.