Skip to content

Commit

Permalink
#155 fix cypress errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickkuypers committed Nov 14, 2023
1 parent 9090cb9 commit fa7076a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/__tests__/OeWizard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ describe('OeWizard', () => {
setup() {
const steps: IStep[] = [
{ name: 'Algemene gegevens', validate: () => Promise.resolve({ valid: true }) },
{ name: 'Mijn gegevens', validate: () => Promise.resolve({ valid: true }) },
{ name: 'Mijn gegevens', validate: () => Promise.resolve({ valid: false }) },
{ name: 'Bijlagen', validate: () => Promise.resolve({ valid: true }) },
{ name: 'Overzicht', validate: () => Promise.resolve({ valid: true }) },
];
Expand Down Expand Up @@ -249,10 +249,10 @@ describe('OeWizard', () => {
},
setup(props) {
const steps: IStep[] = [
{ name: 'Algemene gegevens', validate: () => Promise.resolve(true) },
{ name: 'Mijn gegevens', validate: () => Promise.resolve(true) },
{ name: 'Bijlagen', validate: () => Promise.resolve(true) },
{ name: 'Overzicht', validate: () => Promise.resolve(props.lastStepValid) },
{ name: 'Algemene gegevens', validate: () => Promise.resolve({ valid: true }) },
{ name: 'Mijn gegevens', validate: () => Promise.resolve({ valid: true }) },
{ name: 'Bijlagen', validate: () => Promise.resolve({ valid: true }) },
{ name: 'Overzicht', validate: () => Promise.resolve({ valid: props.lastStepValid }) },
];

return { steps };
Expand Down
4 changes: 2 additions & 2 deletions src/components/dumb/OeWizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const totalSteps = ref(props.steps.length);
const submitDisabled = computedAsync(
async () => {
if (props.disableSubmitWhenInvalid) {
return !(await props.steps[totalSteps.value - 1].validate());
return !(await props.steps[totalSteps.value - 1].validate()).valid;
}
return false;
},
Expand Down Expand Up @@ -112,7 +112,7 @@ const previousStepsAreValid = async (step: number) => {
const steps = props.steps.slice(0, step);
const validations = await Promise.all(steps.map((s) => s.validate()));
return validations.every((v) => v);
return validations.every((v) => v.valid);
};
const reset = () => (currentStep.value = 0);
Expand Down

0 comments on commit fa7076a

Please sign in to comment.