@@ -342,6 +342,61 @@ describe('getFailedCmdRelevantLabware', () => {
342
342
} )
343
343
} )
344
344
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
+
345
400
describe ( 'useFailedLabwareUtils' , ( ) => {
346
401
const mockPickUpTipCommand = {
347
402
key : 'pickUpTipKey' ,
0 commit comments