-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathairGapInTrash.test.ts
69 lines (67 loc) · 1.71 KB
/
airGapInTrash.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
69
import { describe, it, expect } from 'vitest'
import {
DEFAULT_PIPETTE,
getInitialRobotStateStandard,
getSuccessResult,
makeContext,
} from '../fixtures'
import { airGapInTrash } from '../commandCreators/compound'
import type { CutoutId } from '@opentrons/shared-data'
import type { InvariantContext, RobotState } from '../types'
const mockCutout: CutoutId = 'cutoutA3'
const mockTrashId = 'mockTrashId'
const invariantContext: InvariantContext = {
...makeContext(),
additionalEquipmentEntities: {
[mockTrashId]: {
id: mockTrashId,
name: 'trashBin',
pythonName: 'mock_trash_bin_1',
location: mockCutout,
},
},
}
const prevRobotState: RobotState = getInitialRobotStateStandard(
invariantContext
)
describe('airGapInTrash', () => {
it('returns correct commands for airGapInPlace over a trash bin', () => {
const result = airGapInTrash(
{
pipetteId: DEFAULT_PIPETTE,
volume: 10,
flowRate: 10,
trashId: mockTrashId,
},
invariantContext,
prevRobotState
)
expect(getSuccessResult(result).commands).toEqual([
{
commandType: 'moveToAddressableArea',
key: expect.any(String),
params: {
pipetteId: DEFAULT_PIPETTE,
addressableAreaName: 'movableTrashA3',
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,
volume: 10,
flowRate: 10,
},
},
])
})
})