diff --git a/src/__tests__/OeWizard.cy.ts b/src/__tests__/OeWizard.cy.ts index 6a2d5a81..88a89b3d 100644 --- a/src/__tests__/OeWizard.cy.ts +++ b/src/__tests__/OeWizard.cy.ts @@ -203,6 +203,13 @@ describe('OeWizard', () => { cy.dataCy('step-2').click(); cy.get('.wizard__bar-item--current').invoke('text').should('equal', '2Mijn gegevens'); }); + + it('does not navigate to the next step when current step is invalid using next step buttons', () => { + cy.dataCy('next-step-button').click(); + cy.get('.wizard__bar-item--current').invoke('text').should('equal', '2Mijn gegevens'); + cy.dataCy('next-step-button').click(); + cy.get('.wizard__bar-item--current').invoke('text').should('equal', '2Mijn gegevens'); + }); }); describe('mobile view', () => { diff --git a/src/components/dumb/OeWizard.vue b/src/components/dumb/OeWizard.vue index fdafb00e..916d6f8d 100644 --- a/src/components/dumb/OeWizard.vue +++ b/src/components/dumb/OeWizard.vue @@ -93,7 +93,7 @@ const previousStep = () => { }; const nextStep = async () => { - if (currentStep.value < totalSteps.value - 1 && (await props.steps[currentStep.value].validate())) { + if (currentStep.value < totalSteps.value - 1 && (await props.steps[currentStep.value].validate()).valid) { currentStep.value++; } };