File tree Expand file tree Collapse file tree 2 files changed +39
-4
lines changed Expand file tree Collapse file tree 2 files changed +39
-4
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,43 @@ describe('moveLabware', () => {
322
322
type : 'LABWARE_ON_ANOTHER_ENTITY' ,
323
323
} )
324
324
} )
325
+ it ( 'should return an error for trying to move the labware to an occupied module' , ( ) => {
326
+ const state = getInitialRobotStateStandard ( invariantContext )
327
+ const HEATER_SHAKER_ID = 'heaterShakerId'
328
+ const HEATER_SHAKER_SLOT = 'A1'
329
+
330
+ robotState = {
331
+ ...state ,
332
+ modules : {
333
+ ...state . modules ,
334
+ [ HEATER_SHAKER_ID ] : {
335
+ slot : HEATER_SHAKER_SLOT ,
336
+ moduleState : {
337
+ type : HEATERSHAKER_MODULE_TYPE ,
338
+ latchOpen : true ,
339
+ targetSpeed : null ,
340
+ } ,
341
+ } as any ,
342
+ } ,
343
+ labware : {
344
+ ...state . labware ,
345
+ mockLabwareId : {
346
+ slot : HEATER_SHAKER_ID ,
347
+ } ,
348
+ } ,
349
+ }
350
+ const params = {
351
+ labwareId : SOURCE_LABWARE ,
352
+ strategy : 'usingGripper' ,
353
+ newLocation : { moduleId : HEATER_SHAKER_ID } ,
354
+ } as MoveLabwareParams
355
+
356
+ const result = moveLabware ( params , invariantContext , robotState )
357
+ expect ( getErrorResult ( result ) . errors ) . toHaveLength ( 1 )
358
+ expect ( getErrorResult ( result ) . errors [ 0 ] ) . toMatchObject ( {
359
+ type : 'LABWARE_ON_ANOTHER_ENTITY' ,
360
+ } )
361
+ } )
325
362
it ( 'should return an error for the labware already being discarded in previous step' , ( ) => {
326
363
const wasteChuteInvariantContext = {
327
364
...invariantContext ,
Original file line number Diff line number Diff line change @@ -72,10 +72,8 @@ export const moveLabware: CommandCreator<MoveLabwareParams> = (
72
72
)
73
73
74
74
const newLocationSlot =
75
- newLocation !== 'offDeck' &&
76
- newLocation !== 'systemLocation' &&
77
- 'slotName' in newLocation
78
- ? newLocation . slotName
75
+ newLocation !== 'offDeck' && newLocation !== 'systemLocation'
76
+ ? Object . values ( newLocation ) [ 0 ]
79
77
: null
80
78
81
79
const multipleObjectsInSameSlotLabware =
You can’t perform that action at this time.
0 commit comments