-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(protocol-designer): add designerApplication labware, pipettes, m…
…odules keys closes AUTH-1407
- Loading branch information
Showing
8 changed files
with
364 additions
and
126 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { describe, it, expect } from 'vitest' | ||
import { | ||
fixture96Plate, | ||
fixtureP1000SingleV2Specs, | ||
} from '@opentrons/shared-data' | ||
import { | ||
getLabwareLoadInfo, | ||
getModulesLoadInfo, | ||
getPipettesLoadInfo, | ||
} from '../selectors/utils' | ||
import type { LabwareDefinition2, PipetteName } from '@opentrons/shared-data' | ||
|
||
describe('getPipettesLoadInfo', () => { | ||
it('returns pipettes from pipette entities', () => { | ||
const pipId = '1' | ||
const results = { | ||
[pipId]: { | ||
pipetteName: fixtureP1000SingleV2Specs.displayName, | ||
}, | ||
} | ||
expect( | ||
getPipettesLoadInfo({ | ||
pipId: { | ||
spec: fixtureP1000SingleV2Specs, | ||
tiprackLabwareDef: [], | ||
name: fixtureP1000SingleV2Specs.displayName as PipetteName, | ||
id: pipId, | ||
tiprackDefURI: [], | ||
}, | ||
}) | ||
).toEqual(results) | ||
}) | ||
}) | ||
|
||
describe('getModuleLoadInfo', () => { | ||
it('returns modules from module entities', () => { | ||
const moduleId = '1' | ||
const results = { | ||
[moduleId]: { | ||
model: 'magneticModuleV2', | ||
}, | ||
} | ||
expect( | ||
getModulesLoadInfo({ | ||
moduleId: { | ||
id: moduleId, | ||
model: 'magneticModuleV2', | ||
type: 'magneticModuleType', | ||
}, | ||
}) | ||
).toEqual(results) | ||
}) | ||
}) | ||
|
||
describe('getLabwareLoadInfo', () => { | ||
it('returns labwares from labware entities', () => { | ||
const labwareId = '1' | ||
const uri = 'mockUri' | ||
const results = { | ||
[labwareId]: { | ||
displayName: 'nick name', | ||
labwareDefURI: uri, | ||
}, | ||
} | ||
const labwareNicknamesById: Record<string, string> = { | ||
[labwareId]: 'nick name', | ||
} | ||
|
||
expect( | ||
getLabwareLoadInfo( | ||
{ | ||
labwareId: { | ||
id: labwareId, | ||
labwareDefURI: uri, | ||
def: fixture96Plate as LabwareDefinition2, | ||
}, | ||
}, | ||
labwareNicknamesById | ||
) | ||
).toEqual(results) | ||
}) | ||
}) |
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
Oops, something went wrong.