Update and test front end email verification

This commit is contained in:
Christian Cueni 2020-02-13 12:42:17 +01:00
parent 7a532463a6
commit d5276d5adc
3 changed files with 18 additions and 7 deletions

View File

@ -239,6 +239,16 @@
},
"defaultValue": null
},
{
"name": "userIdInput",
"description": null,
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"defaultValue": null
},
{
"name": "clientMutationId",
"description": null,
@ -1489,4 +1499,5 @@
}
]
}
}

View File

@ -23,7 +23,7 @@ describe('Email Verifcation', () => {
}
});
cy.visit('/verify-email?confirmation=abcd1234');
cy.visit('/verify-email?confirmation=abcd1234&userId=12');
// user should be logged in at that stage. As the cookie cannot be set at the right time
// we just check if the user gets redirected to the login page as we can't log her in
@ -53,7 +53,7 @@ describe('Email Verifcation', () => {
}
});
cy.visit('/verify-email?confirmation=abcd1234');
cy.visit('/verify-email?confirmation=abcd1234&userId=12');
cy.get('[data-cy="code-nok-msg"]').contains('Der angegebene Verifizierungscode ist falsch oder abgelaufen.');
cy.get('[data-cy="code-ok-msg"]').should('not.exist');
@ -81,7 +81,7 @@ describe('Email Verifcation', () => {
}
});
cy.visit('/verify-email?confirmation=abcd1234');
cy.visit('/verify-email?confirmation=abcd1234&userId=12');
cy.get('[data-cy="code-nok-msg"]').contains('Ein Fehler ist aufgetreten. Bitte kontaktieren Sie den Administrator.');
});
@ -108,7 +108,7 @@ describe('Email Verifcation', () => {
}
});
cy.visit('/verify-email?confirmation=abcd1234');
cy.visit('/verify-email?confirmation=abcd1234&userId=12');
// user should be logged in at that stage. As the cookie cannot be set at the right time
// we just check if the user gets redirected to the coupon page as we can't log her in

View File

@ -41,14 +41,14 @@ export default {
client: 'publicClient',
variables: {
input: {
confirmationKeyInput: this.$route.query.confirmation || ''
confirmationKeyInput: this.$route.query.confirmation,
userIdInput: this.$route.query.userId
}
},
fetchPolicy: 'no-cache'
}).then(data => {
}).then(({data}) => {
this.loading = false;
if (data.registration.success) {
this.keyValid = true;
this.$router.push('/');