File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
app/src/organisms/ChangePipette Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export function ConfirmPipette(props: ConfirmPipetteProps): JSX.Element {
58
58
actualPipette,
59
59
setConfirmPipetteLevel,
60
60
confirmPipetteLevel,
61
+ isDisabled,
61
62
} = props
62
63
const { t } = useTranslation ( 'change_pipette' )
63
64
@@ -141,6 +142,7 @@ export function ConfirmPipette(props: ConfirmPipetteProps): JSX.Element {
141
142
< SuccessAndExitButtons
142
143
{ ...props }
143
144
confirmPipetteLevel = { confirmPipetteLevel }
145
+ isDisabled = { isDisabled }
144
146
/>
145
147
) : null }
146
148
</ >
@@ -221,6 +223,7 @@ function SuccessAndExitButtons(props: ConfirmPipetteProps): JSX.Element {
221
223
toCalibrationDashboard,
222
224
success,
223
225
wrongWantedPipette,
226
+ isDisabled,
224
227
} = props
225
228
const { t } = useTranslation ( 'change_pipette' )
226
229
return (
@@ -230,11 +233,16 @@ function SuccessAndExitButtons(props: ConfirmPipetteProps): JSX.Element {
230
233
< SecondaryButton
231
234
marginRight = { SPACING . spacing8 }
232
235
onClick = { toCalibrationDashboard }
236
+ disabled = { isDisabled }
233
237
>
234
238
{ t ( 'calibrate_pipette_offset' ) }
235
239
</ SecondaryButton >
236
240
) : null }
237
- < PrimaryButton textTransform = { TEXT_TRANSFORM_CAPITALIZE } onClick = { exit } >
241
+ < PrimaryButton
242
+ textTransform = { TEXT_TRANSFORM_CAPITALIZE }
243
+ onClick = { exit }
244
+ disabled = { isDisabled }
245
+ >
238
246
{ t ( 'shared:exit' ) }
239
247
</ PrimaryButton >
240
248
</ >
Original file line number Diff line number Diff line change @@ -427,7 +427,19 @@ describe('ConfirmPipette', () => {
427
427
fireEvent . click ( pocBtn )
428
428
expect ( props . toCalibrationDashboard ) . toBeCalled ( )
429
429
} )
430
- it ( 'should render buttons as disabled when robot is in motion/isDisabled is true' , ( ) => {
430
+ it ( 'should render buttons as disabled on success when robot is in motion/isDisabled is true' , ( ) => {
431
+ props = {
432
+ ...props ,
433
+ success : true ,
434
+ isDisabled : true ,
435
+ }
436
+ const { getByRole } = render ( props )
437
+ expect ( getByRole ( 'button' , { name : 'exit' } ) ) . toBeDisabled ( )
438
+ expect (
439
+ getByRole ( 'button' , { name : 'Calibrate pipette offset' } )
440
+ ) . toBeDisabled ( )
441
+ } )
442
+ it ( 'should render buttons as disabled on failure when robot is in motion/isDisabled is true' , ( ) => {
431
443
props = {
432
444
...props ,
433
445
success : false ,
You can’t perform that action at this time.
0 commit comments