-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathairGapInWasteChute.test.ts
68 lines (66 loc) · 1.69 KB
/
airGapInWasteChute.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { describe, it, expect } from 'vitest'
import { WASTE_CHUTE_CUTOUT } from '@opentrons/shared-data'
import {
DEFAULT_PIPETTE,
getInitialRobotStateStandard,
getSuccessResult,
makeContext,
} from '../fixtures'
import { airGapInWasteChute } from '../commandCreators/compound'
import type { InvariantContext, RobotState } from '../types'
const wasteChuteId = 'wasteChuteId'
const invariantContext: InvariantContext = {
...makeContext(),
additionalEquipmentEntities: {
[wasteChuteId]: {
id: wasteChuteId,
name: 'wasteChute',
pythonName: 'mock_waste_chute_1',
location: WASTE_CHUTE_CUTOUT,
},
},
}
const prevRobotState: RobotState = getInitialRobotStateStandard(
invariantContext
)
describe('airGapInWasteChute', () => {
it('returns correct commands for air gap in waste chute', () => {
const result = airGapInWasteChute(
{
pipetteId: DEFAULT_PIPETTE,
volume: 10,
flowRate: 10,
wasteChuteId,
},
invariantContext,
prevRobotState
)
expect(getSuccessResult(result).commands).toEqual([
{
commandType: 'moveToAddressableArea',
key: expect.any(String),
params: {
pipetteId: DEFAULT_PIPETTE,
addressableAreaName: '1ChannelWasteChute',
offset: { x: 0, y: 0, z: 0 },
},
},
{
commandType: 'prepareToAspirate',
key: expect.any(String),
params: {
pipetteId: DEFAULT_PIPETTE,
},
},
{
commandType: 'airGapInPlace',
key: expect.any(String),
params: {
pipetteId: DEFAULT_PIPETTE,
flowRate: 10,
volume: 10,
},
},
])
})
})