diff --git a/cypress/e2e/pages/sectioningPlanning.cy.ts b/cypress/e2e/pages/sectioningPlanning.cy.ts index 1067ace9..c3f11912 100644 --- a/cypress/e2e/pages/sectioningPlanning.cy.ts +++ b/cypress/e2e/pages/sectioningPlanning.cy.ts @@ -21,8 +21,19 @@ describe('Sectioning Planning', () => { cy.get('#labwareScanInput').should('not.be.disabled'); }); }); + context('number of labware is defined greater than 1', () => { + before(() => { + cy.get('#labwareScanInput').type('STAN-113{enter}'); + cy.findByTestId('numLabware').type('{selectall}').type('2'); + cy.findByText('+ Add Labware').click(); + }); + it('create as much labware layouts as much precised ', () => { + cy.findAllByTestId('labware-').should('have.length', 2); + }); + }); context('when a source labware loaded with fetal samples less than 12 weeks old', () => { before(() => { + cy.reload(); const sourceLabware = labwareFactory.build( { barcode: 'STAN-113' }, { @@ -140,11 +151,6 @@ describe('Sectioning Planning', () => { cy.findByText('Delete Layout').should('not.exist'); }); - it('disables the form inputs', () => { - cy.findByLabelText('Number of Labware').should('be.disabled'); - cy.findByLabelText('Section Thickness').should('be.disabled'); - }); - it('shows the LabelPrinter', () => { cy.findByText('Print Labels').should('be.visible'); }); diff --git a/src/components/planning/LabwarePlan.tsx b/src/components/planning/LabwarePlan.tsx index 7f42aa49..40bec886 100644 --- a/src/components/planning/LabwarePlan.tsx +++ b/src/components/planning/LabwarePlan.tsx @@ -52,9 +52,6 @@ type LabwarePlanProps = { sampleColors: Map; - /** Specified number of labware when setting the plan */ - numLabware: number; - /** Specified section thickness when setting the plan */ sectionThickness: number; /** @@ -81,7 +78,6 @@ const LabwarePlan = React.forwardRef( sampleColors, operationType, sourceLabware, - numLabware, sectionThickness }, ref @@ -139,7 +135,7 @@ const LabwarePlan = React.forwardRef( className="relative p-3 shadow" > - initialValues={buildInitialValues(operationType, outputLabware.labwareType, numLabware, sectionThickness)} + initialValues={buildInitialValues(operationType, outputLabware.labwareType, sectionThickness)} validationSchema={buildValidationSchema(outputLabware.labwareType)} onSubmit={async (values) => { const newValues = { @@ -195,18 +191,6 @@ const LabwarePlan = React.forwardRef( /> )} - {outputLabware.labwareType.name !== LabwareTypeName.VISIUM_LP && - outputLabware.labwareType.name !== LabwareTypeName.XENIUM && ( - - )} - {outputLabware.labwareType.name !== LabwareTypeName.FETAL_WASTE_CONTAINER && ( destinationLabwareTypeName: context.layoutPlan.destinationLabware.labwareType.name, barcode: event.barcode }); - const labware: PlanRequestLabware[] = new Array(event.quantity).fill(planRequestLabware); return { - labware, + labware: [planRequestLabware], operationType: event.operationType }; }, diff --git a/src/pages/sectioning/Plan.tsx b/src/pages/sectioning/Plan.tsx index 0f6321cc..7493303c 100644 --- a/src/pages/sectioning/Plan.tsx +++ b/src/pages/sectioning/Plan.tsx @@ -93,14 +93,13 @@ function Plan() { sourceLabware={sourceLabware} onDeleteButtonClick={deleteAction} onComplete={confirmAction!} - numLabware={numLabware} sectionThickness={sectionThickness} /> ))} ); }, - [sectionThickness, numLabware] + [sectionThickness] ); const buildPlanCreationSettings = React.useCallback(() => { return ( @@ -143,6 +142,7 @@ function Plan() {
operationType={'Section'} + numPlansToCreate={numLabware} selectedLabwareType={allowedLabwareTypes.find((lt) => lt.name === selectedLabwareType)} onPlanChanged={handlePlanChange} buildPlanCreationSettings={buildPlanCreationSettings} diff --git a/tests/unit/components/planning/labwarePlan.spec.tsx b/tests/unit/components/planning/labwarePlan.spec.tsx index 4abf2e03..fd2a57be 100644 --- a/tests/unit/components/planning/labwarePlan.spec.tsx +++ b/tests/unit/components/planning/labwarePlan.spec.tsx @@ -272,7 +272,6 @@ const renderLabwarePlan = (outputLabwareType: string) => { sourceLabware={[buildFlaggedLabware(LabwareTypeName.TUBE)]} onDeleteButtonClick={jest.fn()} onComplete={jest.fn()} - numLabware={2} sectionThickness={3} />