Skip to content

Commit

Permalink
#167 Fix wizard next step button when invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
wouter-adriaens committed Nov 17, 2023
1 parent 204878d commit dbbd49f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/__tests__/OeWizard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dumb/OeWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
};
Expand Down

0 comments on commit dbbd49f

Please sign in to comment.