Skip to content

Commit 7a2c6e4

Browse files
committed
do not show module setup banner if no pipette is attached
1 parent b0ca41b commit 7a2c6e4

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

app/src/molecules/UpdateBanner/__tests__/UpdateBanner.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,21 @@ describe('Module Update Banner', () => {
123123
expect(screen.queryByText('Setup module')).not.toBeInTheDocument()
124124
})
125125

126+
it('should not render module setup banner if pipette calibration is required', () => {
127+
props = {
128+
...props,
129+
updateType: 'setup',
130+
calibratePipetteRequired: true,
131+
}
132+
render(props)
133+
expect(
134+
screen.queryByLabelText(
135+
'ModuleCard_calibration_update_banner_test_number'
136+
)
137+
).not.toBeInTheDocument()
138+
expect(screen.queryByText('Setup module')).not.toBeInTheDocument()
139+
})
140+
126141
it('should not render a module setup link if pipette firmware update is required', () => {
127142
props = {
128143
...props,

app/src/molecules/UpdateBanner/index.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ export const UpdateBanner = ({
5252
}
5353

5454
const canProceed =
55-
updateType === 'calibration'
56-
? !isEstopNotDisengaged &&
55+
updateType === 'firmware'
56+
? true
57+
: !isEstopNotDisengaged &&
5758
!isTooHot &&
5859
!attachPipetteRequired &&
5960
!calibratePipetteRequired &&
6061
!updatePipetteFWRequired
61-
: true
6262

6363
const getMessage = (): string => {
6464
switch (updateType) {
@@ -81,7 +81,12 @@ export const UpdateBanner = ({
8181

8282
const isFlex = useIsFlex(robotName)
8383
// Only show banner for needing firmware update if robot is an OT-2
84-
if (!isFlex && updateType !== 'firmware') return null
84+
if (!isFlex && updateType !== 'firmware') {
85+
return null
86+
}
87+
if (updateType === 'setup' && !canProceed) {
88+
return null
89+
}
8590
return (
8691
<Flex
8792
data-testid={`ModuleCard_${updateType}_update_banner_${serialNumber}`}

0 commit comments

Comments
 (0)