Skip to content

Commit e5f7ba5

Browse files
authored
fix(app): fix recovery tip source location for aspirate/dispenseInPlace commands (#18759)
Closes RABR-791
1 parent e478e41 commit e5f7ba5

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

app/src/organisms/ErrorRecoveryFlows/hooks/__tests__/useFailedLabwareUtils.test.tsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,61 @@ describe('getFailedCmdRelevantLabware', () => {
342342
})
343343
})
344344

345+
describe('getRelevantPickUpTipCommand', () => {
346+
it('should return null when failedCommandByRunRecord does not have pipetteId in params', () => {
347+
const failedCommand = {
348+
commandType: 'dispenseInPlace',
349+
params: {
350+
wellName: 'A1',
351+
},
352+
} as any
353+
354+
const runCommands = {
355+
data: [failedCommand],
356+
} as any
357+
358+
const result = getRelevantFailedLabwareCmdFrom({
359+
failedCommand: { byRunRecord: failedCommand } as any,
360+
runCommands,
361+
})
362+
363+
expect(result).toBeNull()
364+
})
365+
366+
it('should return pickUpTip command when failedCommandByRunRecord has pipetteId', () => {
367+
const pickUpTipCommand = {
368+
key: 'pickUpTipKey',
369+
commandType: 'pickUpTip',
370+
params: {
371+
pipetteId: 'pipetteId',
372+
labwareId: 'labwareId',
373+
wellName: 'A1',
374+
},
375+
} as any
376+
377+
const failedCommand = {
378+
key: 'failedKey',
379+
commandType: 'dispenseInPlace',
380+
params: {
381+
pipetteId: 'pipetteId',
382+
labwareId: 'labwareId',
383+
},
384+
error: { isDefined: true, errorType: DEFINED_ERROR_TYPES.OVERPRESSURE },
385+
} as any
386+
387+
const runCommands = {
388+
data: [pickUpTipCommand, failedCommand],
389+
} as any
390+
391+
const result = getRelevantFailedLabwareCmdFrom({
392+
failedCommand: { byRunRecord: failedCommand } as any,
393+
runCommands,
394+
})
395+
396+
expect(result).toBe(pickUpTipCommand)
397+
})
398+
})
399+
345400
describe('useFailedLabwareUtils', () => {
346401
const mockPickUpTipCommand = {
347402
key: 'pickUpTipKey',

app/src/organisms/ErrorRecoveryFlows/hooks/useFailedLabwareUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ function getRelevantPickUpTipCommand(
214214
if (
215215
failedCommandByRunRecord == null ||
216216
runCommands == null ||
217-
!('wellName' in failedCommandByRunRecord.params) ||
218217
!('pipetteId' in failedCommandByRunRecord.params)
219218
) {
220219
return null

0 commit comments

Comments
 (0)