From 4645396bd5a4e41f15409a3866e376b01541e76a Mon Sep 17 00:00:00 2001 From: Jethary Rader <66035149+jerader@users.noreply.github.com> Date: Mon, 6 May 2024 15:01:56 -0400 Subject: [PATCH] fix(protocol-designer): default tiprack selection refreshing (#15100) closes AUTH-382 AUTH-383 --- .../modals/CreateFileWizard/PipetteTipsTile.tsx | 10 ++++------ .../__tests__/CreateFileWizard.test.tsx | 3 ++- .../__tests__/PipetteTipsTile.test.tsx | 1 + .../src/components/modals/CreateFileWizard/index.tsx | 5 ++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx b/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx index 0a154592345..a95c4054f2d 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx @@ -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 ( { 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) diff --git a/protocol-designer/src/components/modals/CreateFileWizard/__tests__/PipetteTipsTile.test.tsx b/protocol-designer/src/components/modals/CreateFileWizard/__tests__/PipetteTipsTile.test.tsx index 821acd65ef6..ce5e29f06a8 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/__tests__/PipetteTipsTile.test.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/__tests__/PipetteTipsTile.test.tsx @@ -51,6 +51,7 @@ const mockWizardTileProps: Partial = { 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 = { diff --git a/protocol-designer/src/components/modals/CreateFileWizard/index.tsx b/protocol-designer/src/components/modals/CreateFileWizard/index.tsx index 53ae9a88f6a..ecc37ea4b26 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/index.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/index.tsx @@ -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({