From 0bb71cfbb378c655998a2d7420447f4f1e78fddd Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 22 Aug 2019 13:26:51 +0200 Subject: [PATCH] Specs tests run through cleanly --- backend/src/middleware/slugifyMiddleware.spec.js | 13 ++++++++++--- backend/src/schema/resolvers/registration.spec.js | 6 ++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/backend/src/middleware/slugifyMiddleware.spec.js b/backend/src/middleware/slugifyMiddleware.spec.js index 0f42def85..d11757bc7 100644 --- a/backend/src/middleware/slugifyMiddleware.spec.js +++ b/backend/src/middleware/slugifyMiddleware.spec.js @@ -89,8 +89,10 @@ describe('slugify', () => { }) describe('SignupVerification', () => { - const mutation = `mutation($password: String!, $email: String!, $name: String!, $slug: String, $nonce: String!) { - SignupVerification(email: $email, password: $password, name: $name, slug: $slug, nonce: $nonce) { slug } + const mutation = `mutation($password: String!, $email: String!, $name: String!, $slug: String, $nonce: String!, $termsAndConditionsAgreedVersion: String!) { + SignupVerification(email: $email, password: $password, name: $name, slug: $slug, nonce: $nonce, termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion) { + slug + } } ` @@ -98,7 +100,12 @@ describe('slugify', () => { // required for SignupVerification await instance.create('EmailAddress', { email: '123@example.org', nonce: '123456' }) - const defaultVariables = { nonce: '123456', password: 'yo', email: '123@example.org' } + const defaultVariables = { + nonce: '123456', + password: 'yo', + email: '123@example.org', + termsAndConditionsAgreedVersion: '0.0.1', + } return authenticatedClient.request(mutation, { ...defaultVariables, ...variables }) } diff --git a/backend/src/schema/resolvers/registration.spec.js b/backend/src/schema/resolvers/registration.spec.js index 9f9a171f7..c68f38382 100644 --- a/backend/src/schema/resolvers/registration.spec.js +++ b/backend/src/schema/resolvers/registration.spec.js @@ -34,6 +34,7 @@ describe('CreateInvitationCode', () => { name: 'Inviter', email: 'inviter@example.org', password: '1234', + termsAndConditionsAgreedVersion: '0.0.1', } action = async () => { const factory = Factory() @@ -293,8 +294,8 @@ describe('Signup', () => { describe('SignupVerification', () => { const mutation = ` - mutation($name: String!, $password: String!, $email: String!, $nonce: String!) { - SignupVerification(name: $name, password: $password, email: $email, nonce: $nonce) { + mutation($name: String!, $password: String!, $email: String!, $nonce: String!, $termsAndConditionsAgreedVersion: String!) { + SignupVerification(name: $name, password: $password, email: $email, nonce: $nonce, termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion) { id } } @@ -305,6 +306,7 @@ describe('SignupVerification', () => { name: 'John Doe', password: '123', email: 'john@example.org', + termsAndConditionsAgreedVersion: '0.0.1', } describe('unauthenticated', () => {