Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Oct 18, 2023
1 parent c2a8c9d commit 07be0f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ export const LabwareSelectionModal = (props: Props): JSX.Element | null => {
return `Slot ${slot} Labware`
}

const getLabwareAdapterItem = (index: number, labwareDefUri?: string) => {
const getLabwareAdapterItem = (
index: number,
labwareDefUri?: string
): JSX.Element | null => {
const labwareDef = labwareDefUri != null ? defs[labwareDefUri] : null
return labwareDef != null ? (
<LabwareItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import {
getIsLabwareAboveHeight,
MAX_LABWARE_HEIGHT_EAST_WEST_HEATER_SHAKER_MM,
} from '@opentrons/shared-data'
import { getLabwareCompatibleWithAdapter } from '../../../utils/labwareModuleCompatibility'
import {
ADAPTER_96_CHANNEL,
getLabwareCompatibleWithAdapter,
} from '../../../utils/labwareModuleCompatibility'
import { Portal } from '../../portals/TopPortal'
import { LabwareSelectionModal } from '../LabwareSelectionModal'

Expand Down Expand Up @@ -62,13 +65,14 @@ describe('LabwareSelectionModal', () => {
)
})
it('should display only permitted tipracks if the 96-channel is attached', () => {
const mockPermittedTipracks = ['mockPermittedTip', 'mockPermittedTip2']
const mockTipUri = 'fixture/fixture_tiprack_1000_ul/1'
const mockPermittedTipracks = [mockTipUri]
props.slot = 'A2'
props.has96Channel = true
props.adapterLoadName = 'mockLoadName'
props.adapterLoadName = ADAPTER_96_CHANNEL
props.permittedTipracks = mockPermittedTipracks
const { getByText, getAllByRole } = render(props)
const { getByText } = render(props)
getByText(nestedTextMatcher('adapter compatible labware')).click()
expect(getAllByRole('list', { name: '' })).toHaveLength(2)
getByText('Opentrons GEB 1000uL Tiprack')
})
})

0 comments on commit 07be0f5

Please sign in to comment.