Skip to content

Commit

Permalink
render none
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Apr 9, 2024
1 parent 3c05216 commit e2a2894
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
22 changes: 13 additions & 9 deletions components/src/instrument/InstrumentInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,19 @@ export function InstrumentInfo(props: InstrumentInfoProps): JSX.Element {
Tip rack
</StyledText>
<ul>
{tiprackModels != null
? tiprackModels.map((model, index) => (
<li key={`${model}_${index}`}>
<StyledText as="p" width="max-content" maxWidth="14rem">
{model}
</StyledText>
</li>
))
: null}
{tiprackModels != null ? (
tiprackModels.map((model, index) => (
<li key={`${model}_${index}`}>
<StyledText as="p" width="max-content" maxWidth="14rem">
{model}
</StyledText>
</li>
))
) : (
<StyledText as="p" width="max-content" maxWidth="14rem">
None
</StyledText>
)}
</ul>
</Flex>
</Flex>
Expand Down
6 changes: 6 additions & 0 deletions components/src/instrument/__tests__/InstrumentInfo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ describe('InstrumentInfo', () => {
screen.getByText('Tip rack')
screen.getByText('mock1')
})
it('renders none for pip and tiprack if none are selected', () => {
props.pipetteSpecs = undefined
props.tiprackModels = undefined
render(props)
screen.getByText('None')
})
})

0 comments on commit e2a2894

Please sign in to comment.