Skip to content

Commit

Permalink
fix(protocol-designer): default tiprack selection refreshing (#15100)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader authored May 6, 2024
1 parent 2066225 commit 4645396
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,10 @@ function PipetteTipsField(props: PipetteTipsFieldProps): JSX.Element | null {
const selectedValues = pipettesByMount[mount].tiprackDefURI ?? []

React.useEffect(() => {
if (selectedValues.length === 0) {
setValue(`pipettesByMount.${mount}.tiprackDefURI`, [
tiprackOptions[0]?.value ?? '',
])
}
}, [selectedValues, setValue, tiprackOptions])
setValue(`pipettesByMount.${mount}.tiprackDefURI`, [
tiprackOptions[0]?.value ?? '',
])
}, [])

return (
<Flex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ describe('CreateFileWizard', () => {
next = screen.getByRole('button', { name: 'Next' })
fireEvent.click(next)
screen.getByText('Step 3 / 6')
// select 10uL tipracks
// un-select default 10uL tiprack then select again
fireEvent.click(screen.getByLabelText('EquipmentOption_flex_10uL tipracks'))
fireEvent.click(screen.getByLabelText('EquipmentOption_flex_10uL tipracks'))
next = screen.getByRole('button', { name: 'Next' })
fireEvent.click(next)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const mockWizardTileProps: Partial<WizardTileProps> = {
proceed: vi.fn(),
watch: vi.fn((name: keyof typeof values) => values[name]) as any,
getValues: vi.fn(() => values) as any,
setValue: vi.fn(),
}

const fixtureTipRack10ul = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ export function CreateFileWizard(): JSX.Element | null {
pipettes.flatMap(pipette => pipette.tiprackDefURI)
)
const FLEX_MIDDLE_SLOTS = ['C2', 'B2', 'A2']
const OT2_MIDDLE_SLOTS = ['2', '5', '8', '11']
const hasOt2TC = modules.find(
module => module.type === THERMOCYCLER_MODULE_TYPE
)
const OT2_MIDDLE_SLOTS = hasOt2TC ? ['2', '5'] : ['2', '5', '8', '11']
newTiprackModels.forEach((tiprackDefURI, index) => {
dispatch(
labwareIngredActions.createContainer({
Expand Down

0 comments on commit 4645396

Please sign in to comment.