Skip to content

Commit

Permalink
fix(app): do not disable heater shaker temp control when shaking (#12425
Browse files Browse the repository at this point in the history
)

Only the shake controls of the heater shaker module need to be disabled if the module is shaking. No
need to disable temperature controls too

Closes RQA-617
  • Loading branch information
b-cooper authored Apr 4, 2023
1 parent d1db655 commit f2370ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
6 changes: 2 additions & 4 deletions app/src/organisms/ModuleCard/HeaterShakerSlideout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ export const HeaterShakerSlideout = (
const { createLiveCommand } = useCreateLiveCommandMutation()
const moduleName = getModuleDisplayName(module.moduleModel)
const modulePart = t('temperature')
const isShaking = module.data.speedStatus !== 'idle'

const sendSetTemperatureOrShakeCommand: React.MouseEventHandler<HTMLInputElement> = e => {
const sendSetTemperatureCommand: React.MouseEventHandler<HTMLInputElement> = e => {
e.preventDefault()
e.stopPropagation()

Expand Down Expand Up @@ -89,7 +88,7 @@ export const HeaterShakerSlideout = (
<SubmitPrimaryButton
form="HeaterShakerSlideout_submitValue"
value={t('confirm')}
onClick={sendSetTemperatureOrShakeCommand}
onClick={sendSetTemperatureCommand}
disabled={hsValue === null || errorMessage !== null}
data-testid={`HeaterShakerSlideout_btn_${module.serialNumber}`}
/>
Expand Down Expand Up @@ -131,7 +130,6 @@ export const HeaterShakerSlideout = (
unit: unit,
})}
error={errorMessage}
disabled={isShaking}
/>
</form>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,6 @@ const render = (props: React.ComponentProps<typeof HeaterShakerSlideout>) => {
})[0]
}

const mockMovingHeaterShaker = {
id: 'heatershaker_id',
moduleModel: 'heaterShakerModuleV1',
moduleType: 'heaterShakerModuleType',
serialNumber: 'jkl123',
hardwareRevision: 'heatershaker_v4.0',
firmwareVersion: 'v2.0.0',
hasAvailableUpdate: true,
data: {
labwareLatchStatus: 'idle_closed',
speedStatus: 'speeding up',
temperatureStatus: 'idle',
currentSpeed: null,
currentTemperature: null,
targetSpeed: null,
targetTemp: null,
errorDetails: null,
status: 'idle',
},
usbPort: { path: '/dev/ot_module_heatershaker0', port: 1 },
} as any

describe('HeaterShakerSlideout', () => {
let props: React.ComponentProps<typeof HeaterShakerSlideout>
let mockCreateLiveCommand = jest.fn()
Expand Down Expand Up @@ -111,15 +89,4 @@ describe('HeaterShakerSlideout', () => {
expect(props.onCloseClick).toHaveBeenCalled()
expect(input).not.toHaveValue()
})

it('input value is disabled when heater shaker is shaking', () => {
props = {
module: mockMovingHeaterShaker,
isExpanded: true,
onCloseClick: jest.fn(),
}
const { getByTestId } = render(props)
const input = getByTestId('heaterShakerModuleV1_setTemp')
expect(input).toBeDisabled()
})
})

0 comments on commit f2370ac

Please sign in to comment.