-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app): Expose Labware Calibration Status on the FileInfo Page (#6100
) Display the current stored calibration offset for all labware used in the protocol, better-enabling users to decide whether labware calibration is necessary without providing an explicit recommendation. Co-authored-by: Seth Foster <[email protected]> Co-authored-by: Mike Cousins <[email protected]>
- Loading branch information
1 parent
6350511
commit 2a22f59
Showing
35 changed files
with
1,411 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
export * from './actions' | ||
export * from './constants' | ||
export * from './selectors' | ||
export * from './labware' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @flow | ||
export * from './labware-calibration' |
77 changes: 77 additions & 0 deletions
77
app/src/calibration/labware/__fixtures__/labware-calibration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// @flow | ||
import { GET } from '../../../robot-api' | ||
import { | ||
makeResponseFixtures, | ||
mockFailureBody, | ||
} from '../../../robot-api/__fixtures__' | ||
import { LABWARE_CALIBRATION_PATH } from '../constants' | ||
|
||
import type { ResponseFixtures } from '../../../robot-api/__fixtures__' | ||
import type { | ||
LabwareCalibrationModel, | ||
AllLabwareCalibrations, | ||
} from '../../api-types' | ||
|
||
export const mockLabwareCalibration1: LabwareCalibrationModel = { | ||
attributes: { | ||
calibrationData: { | ||
offset: { | ||
value: [0.0, 0.0, 0.0], | ||
lastModified: '2020-04-05T14:30', | ||
}, | ||
tipLength: { | ||
value: 30, | ||
lastModified: '2007-05-05T0:30', | ||
}, | ||
}, | ||
loadName: 'opentrons_96_tiprack_10ul', | ||
namespace: 'opentrons', | ||
version: 1, | ||
parent: 'fake_id', | ||
}, | ||
id: 'some id', | ||
type: 'Labware Calibration', | ||
} | ||
|
||
export const mockLabwareCalibration2: LabwareCalibrationModel = { | ||
attributes: { | ||
calibrationData: { | ||
offset: { | ||
value: [1.0, 1.0, 1.0], | ||
lastModified: '2020-04-05T14:30', | ||
}, | ||
tipLength: { | ||
value: 30, | ||
lastModified: '2007-05-05T0:30', | ||
}, | ||
}, | ||
loadName: 'opentrons_96_tiprack_1000ul', | ||
namespace: 'opentrons', | ||
version: 1, | ||
parent: '', | ||
}, | ||
id: 'some id', | ||
type: 'Labware Calibration', | ||
} | ||
|
||
export const mockAllLabwareCalibraton: AllLabwareCalibrations = { | ||
data: [mockLabwareCalibration1, mockLabwareCalibration2], | ||
meta: {}, | ||
} | ||
|
||
export const { | ||
successMeta: mockFetchLabwareCalibrationSuccessMeta, | ||
failureMeta: mockFetchLabwareCalibrationFailureMeta, | ||
success: mockFetchLabwareCalibrationSuccess, | ||
failure: mockFetchLabwareCalibrationFailure, | ||
}: ResponseFixtures< | ||
AllLabwareCalibrations, | ||
{| message: string |} | ||
> = makeResponseFixtures({ | ||
method: GET, | ||
path: LABWARE_CALIBRATION_PATH, | ||
successStatus: 200, | ||
successBody: mockAllLabwareCalibraton, | ||
failureStatus: 500, | ||
failureBody: mockFailureBody, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// @flow | ||
|
||
import * as Fixtures from '../__fixtures__' | ||
import * as Actions from '../actions' | ||
import type { LawareCalibrationAction } from '../types' | ||
|
||
type ActionSpec = {| | ||
should: string, | ||
creator: (...Array<any>) => LawareCalibrationAction, | ||
args: Array<mixed>, | ||
expected: LawareCalibrationAction, | ||
|} | ||
|
||
const SPECS: Array<ActionSpec> = [ | ||
{ | ||
should: 'create a fetchLabwareCalibrations action', | ||
creator: Actions.fetchLabwareCalibrations, | ||
args: ['robot-name'], | ||
expected: { | ||
type: 'calibration:FETCH_LABWARE_CALIBRATIONS', | ||
payload: { robotName: 'robot-name' }, | ||
meta: {}, | ||
}, | ||
}, | ||
{ | ||
should: 'create a fetchLabwareCalibrationsSuccess action', | ||
creator: Actions.fetchLabwareCalibrationsSuccess, | ||
args: [ | ||
'robot-name', | ||
Fixtures.mockFetchLabwareCalibrationSuccess.body, | ||
{ requestId: '123' }, | ||
], | ||
expected: { | ||
type: 'calibration:FETCH_LABWARE_CALIBRATIONS_SUCCESS', | ||
payload: { | ||
robotName: 'robot-name', | ||
labwareCalibrations: Fixtures.mockAllLabwareCalibraton, | ||
}, | ||
meta: { requestId: '123' }, | ||
}, | ||
}, | ||
{ | ||
should: 'create a fetchLabwareCalibrationsFailure action', | ||
creator: Actions.fetchLabwareCalibrationsFailure, | ||
args: [ | ||
'robot-name', | ||
Fixtures.mockFetchLabwareCalibrationFailure.body, | ||
{ requestId: '123' }, | ||
], | ||
expected: { | ||
type: 'calibration:FETCH_LABWARE_CALIBRATIONS_FAILURE', | ||
payload: { | ||
robotName: 'robot-name', | ||
error: Fixtures.mockFetchLabwareCalibrationFailure.body, | ||
}, | ||
meta: { requestId: '123' }, | ||
}, | ||
}, | ||
] | ||
|
||
describe('calibration actions', () => { | ||
SPECS.forEach(({ should, creator, args, expected }) => { | ||
it(should, () => { | ||
expect(creator(...args)).toEqual(expected) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.