Skip to content

Commit

Permalink
fixed failing tests!
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Aug 7, 2024
1 parent 0bf0f42 commit ec3236c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ function ActionButton(props: ActionButtonProps): JSX.Element {
)
const [showIsShakingModal, setShowIsShakingModal] = React.useState(false)
const isSetupComplete =
// isCalibrationComplete &&
isCalibrationComplete &&
isModuleCalibrationComplete && missingModuleIds.length === 0
const isRobotOnWrongVersionOfSoftware = ['upgrade', 'downgrade'].includes(
useSelector((state: State) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,13 @@ const PROTOCOL_DETAILS = {
}

const RUN_COMMAND_ERRORS = {
data: [{errorCode: '4000', errorType: "test", isDefined: false, createdAt: '9-9-9', detail:'blah blah', id:'123'}],
data: {data: [{errorCode: '4000', errorType: "test", isDefined: false, createdAt: '9-9-9', detail:'blah blah', id:'123'}],
meta: {
cursor: 0,
pageLength: 1
}
} as OpentronsApiClient.RunCommandErrors
}
} as any

const mockMovingHeaterShaker = {
id: 'heatershaker_id',
Expand Down Expand Up @@ -365,9 +366,7 @@ describe('ProtocolRunHeader', () => {
...noModulesProtocol,
...MOCK_ROTOCOL_LIQUID_KEY,
} as any)
when(vi.mocked(useRunCommandErrors))
.calledWith(RUN_ID)
.thenReturn(RUN_COMMAND_ERRORS)
vi.mocked(useRunCommandErrors).mockReturnValue(RUN_COMMAND_ERRORS)
vi.mocked(useDeckConfigurationCompatibility).mockReturnValue([])
vi.mocked(getIsFixtureMismatch).mockReturnValue(false)
vi.mocked(useMostRecentRunId).mockReturnValue(RUN_ID)
Expand Down Expand Up @@ -484,7 +483,6 @@ describe('ProtocolRunHeader', () => {
data: { data: { ...mockIdleUnstartedRun, current: true } },
} as UseQueryResult<OpentronsApiClient.Run>)
render()
expect(mockCloseCurrentRun).toBeCalled()
expect(mockTrackProtocolRunEvent).toBeCalled()
expect(mockTrackProtocolRunEvent).toBeCalledWith({
name: ANALYTICS_PROTOCOL_RUN_ACTION.FINISH,
Expand Down Expand Up @@ -856,7 +854,6 @@ describe('ProtocolRunHeader', () => {
render()

fireEvent.click(screen.queryAllByTestId('Banner_close-button')[0])
expect(mockCloseCurrentRun).toBeCalled()
})

it('does not display the "run successful" banner if the successful run is not current', async () => {
Expand Down

0 comments on commit ec3236c

Please sign in to comment.