1
1
import { describe , it , expect , vi } from 'vitest'
2
2
import { WASTE_CHUTE_CUTOUT } from '@opentrons/shared-data'
3
- import { getSuccessResult , makeContext } from '../fixtures'
3
+ import { DEFAULT_PIPETTE , getSuccessResult , makeContext } from '../fixtures'
4
4
import { dropTipInWasteChute } from '../commandCreators'
5
5
6
- import type { InvariantContext , PipetteEntities , RobotState } from '../types'
6
+ import type { InvariantContext , RobotState } from '../types'
7
7
8
8
vi . mock ( '../getNextRobotStateAndWarnings/dispenseUpdateLiquidState' )
9
9
10
10
const mockWasteChuteId = 'mockWasteChuteId'
11
- const mockId = 'mockId'
12
-
13
- const mockPipEntities : PipetteEntities = {
14
- [ mockId ] : {
15
- name : 'p50_single_flex' ,
16
- id : mockId ,
17
- spec : { channels : 1 } ,
18
- } ,
19
- } as any
20
11
21
12
const invariantContext : InvariantContext = {
22
13
...makeContext ( ) ,
23
- pipetteEntities : mockPipEntities ,
24
14
additionalEquipmentEntities : {
25
15
[ mockWasteChuteId ] : {
26
16
name : 'wasteChute' as const ,
27
17
location : WASTE_CHUTE_CUTOUT ,
28
18
id : mockWasteChuteId ,
19
+ pythonName : 'mock_waste_chute_1' ,
29
20
} ,
30
21
} ,
31
22
}
32
23
const prevRobotState : RobotState = {
33
- tipState : { pipettes : { [ mockId ] : true } } as any ,
24
+ tipState : { pipettes : { [ DEFAULT_PIPETTE ] : true } } as any ,
34
25
} as any
35
26
36
27
describe ( 'dropTipInWasteChute' , ( ) => {
37
- it ( 'returns correct commands for drop tip' , ( ) => {
28
+ it ( 'returns correct commands for drop tip in waste chute ' , ( ) => {
38
29
const args = {
39
- pipetteId : mockId ,
30
+ pipetteId : DEFAULT_PIPETTE ,
31
+ wasteChuteId : mockWasteChuteId ,
40
32
}
41
33
const result = dropTipInWasteChute ( args , invariantContext , prevRobotState )
42
34
expect ( getSuccessResult ( result ) . commands ) . toEqual ( [
43
35
{
44
36
commandType : 'moveToAddressableArea' ,
45
37
key : expect . any ( String ) ,
46
38
params : {
47
- pipetteId : mockId ,
39
+ pipetteId : DEFAULT_PIPETTE ,
48
40
addressableAreaName : '1ChannelWasteChute' ,
49
41
offset : { x : 0 , y : 0 , z : 0 } ,
50
42
} ,
@@ -53,9 +45,12 @@ describe('dropTipInWasteChute', () => {
53
45
commandType : 'dropTipInPlace' ,
54
46
key : expect . any ( String ) ,
55
47
params : {
56
- pipetteId : mockId ,
48
+ pipetteId : DEFAULT_PIPETTE ,
57
49
} ,
58
50
} ,
59
51
] )
52
+ expect ( getSuccessResult ( result ) . python ) . toBe (
53
+ 'mockPythonName.drop_tip(mock_waste_chute_1)'
54
+ )
60
55
} )
61
56
} )
0 commit comments