From fa7076a322e6be79cc009c5d042b44556c051254 Mon Sep 17 00:00:00 2001 From: Yannick Kuypers Date: Tue, 14 Nov 2023 14:14:08 +0100 Subject: [PATCH] #155 fix cypress errors --- src/__tests__/OeWizard.cy.ts | 10 +++++----- src/components/dumb/OeWizard.vue | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/__tests__/OeWizard.cy.ts b/src/__tests__/OeWizard.cy.ts index 183fc831..6a2d5a81 100644 --- a/src/__tests__/OeWizard.cy.ts +++ b/src/__tests__/OeWizard.cy.ts @@ -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 }) }, ]; @@ -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 }; diff --git a/src/components/dumb/OeWizard.vue b/src/components/dumb/OeWizard.vue index 25049247..fdafb00e 100644 --- a/src/components/dumb/OeWizard.vue +++ b/src/components/dumb/OeWizard.vue @@ -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; }, @@ -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);