Skip to content

Commit

Permalink
refactor(app): robotType for more OT-2 calibration flows
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Dec 19, 2024
1 parent c29f800 commit 92166a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/redux/analytics/__tests__/make-event.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { vi, describe, it, expect, beforeEach } from 'vitest'

import { OT2_ROBOT_TYPE } from '@opentrons/shared-data'

import { makeEvent } from '../make-event'
import * as selectors from '../selectors'

Expand Down Expand Up @@ -49,6 +51,7 @@ describe('analytics events map', () => {
name: 'pipetteOffsetCalibrationStarted',
properties: {
...action.payload,
robotType: OT2_ROBOT_TYPE,
},
})
})
Expand All @@ -65,6 +68,7 @@ describe('analytics events map', () => {
name: 'tipLengthCalibrationStarted',
properties: {
...action.payload,
robotType: OT2_ROBOT_TYPE,
},
})
})
Expand All @@ -77,6 +81,7 @@ describe('analytics events map', () => {
robotName: 'my-robot',
sessionId: 'seshid',
command: { command: 'calibration.exitSession' },
robotType: OT2_ROBOT_TYPE,
},
} as any
vi.mocked(selectors.getAnalyticsSessionExitDetails).mockReturnValue({
Expand All @@ -86,7 +91,7 @@ describe('analytics events map', () => {

return expect(makeEvent(action, state)).resolves.toEqual({
name: 'my-session-typeExit',
properties: { step: 'session-step' },
properties: { step: 'session-step', robotType: OT2_ROBOT_TYPE },
})
})

Expand Down Expand Up @@ -117,12 +122,11 @@ describe('analytics events map', () => {
properties: {
pipetteModel: 'my-pipette-model',
tipRackDisplayName: 'some display name',
robotType: OT2_ROBOT_TYPE,
},
})
})
})

describe('events with calibration data', () => {
it('analytics:RESOURCE_MONITOR_REPORT -> resourceMonitorReport event', () => {
const state = {} as any
const action = {
Expand Down
2 changes: 2 additions & 0 deletions app/src/redux/analytics/make-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export function makeEvent(
name: 'pipetteOffsetCalibrationStarted',
properties: {
...action.payload,
robotType: OT2_ROBOT_TYPE,
},
})
}
Expand All @@ -246,6 +247,7 @@ export function makeEvent(
name: 'tipLengthCalibrationStarted',
properties: {
...action.payload,
robotType: OT2_ROBOT_TYPE,
},
})
}
Expand Down

0 comments on commit 92166a1

Please sign in to comment.