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 {
5858 actualPipette,
5959 setConfirmPipetteLevel,
6060 confirmPipetteLevel,
61+ isDisabled,
6162 } = props
6263 const { t } = useTranslation ( 'change_pipette' )
6364
@@ -141,6 +142,7 @@ export function ConfirmPipette(props: ConfirmPipetteProps): JSX.Element {
141142 < SuccessAndExitButtons
142143 { ...props }
143144 confirmPipetteLevel = { confirmPipetteLevel }
145+ isDisabled = { isDisabled }
144146 />
145147 ) : null }
146148 </ >
@@ -221,6 +223,7 @@ function SuccessAndExitButtons(props: ConfirmPipetteProps): JSX.Element {
221223 toCalibrationDashboard,
222224 success,
223225 wrongWantedPipette,
226+ isDisabled,
224227 } = props
225228 const { t } = useTranslation ( 'change_pipette' )
226229 return (
@@ -230,11 +233,16 @@ function SuccessAndExitButtons(props: ConfirmPipetteProps): JSX.Element {
230233 < SecondaryButton
231234 marginRight = { SPACING . spacing8 }
232235 onClick = { toCalibrationDashboard }
236+ disabled = { isDisabled }
233237 >
234238 { t ( 'calibrate_pipette_offset' ) }
235239 </ SecondaryButton >
236240 ) : null }
237- < PrimaryButton textTransform = { TEXT_TRANSFORM_CAPITALIZE } onClick = { exit } >
241+ < PrimaryButton
242+ textTransform = { TEXT_TRANSFORM_CAPITALIZE }
243+ onClick = { exit }
244+ disabled = { isDisabled }
245+ >
238246 { t ( 'shared:exit' ) }
239247 </ PrimaryButton >
240248 </ >
Original file line number Diff line number Diff line change @@ -427,7 +427,19 @@ describe('ConfirmPipette', () => {
427427 fireEvent . click ( pocBtn )
428428 expect ( props . toCalibrationDashboard ) . toBeCalled ( )
429429 } )
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' , ( ) => {
431443 props = {
432444 ...props ,
433445 success : false ,
You can’t perform that action at this time.
0 commit comments