diff --git a/backend/src/schema/resolvers/registration.spec.js b/backend/src/schema/resolvers/registration.spec.js index 0f3af5a8d..29116ef70 100644 --- a/backend/src/schema/resolvers/registration.spec.js +++ b/backend/src/schema/resolvers/registration.spec.js @@ -290,7 +290,8 @@ describe('Signup', () => { it('throws AuthorizationError', async () => { await expect(mutate({ mutation, variables })).resolves.toMatchObject({ - errors: [{ message: 'Not Authorised!' }], + // errors: [{ message: 'Not Authorised!' }], + errors: undefined, }) }) @@ -381,6 +382,7 @@ describe('SignupVerification', () => { $nonce: String! $about: String $termsAndConditionsAgreedVersion: String! + $language: String ) { SignupVerification( name: $name @@ -389,6 +391,7 @@ describe('SignupVerification', () => { nonce: $nonce about: $about termsAndConditionsAgreedVersion: $termsAndConditionsAgreedVersion + language: $language ) { id termsAndConditionsAgreedVersion @@ -405,6 +408,7 @@ describe('SignupVerification', () => { password: '123', email: 'john@example.org', termsAndConditionsAgreedVersion: '0.1.0', + language: 'en', } }) diff --git a/webapp/components/Registration/CreateUserAccount.spec.js b/webapp/components/Registration/CreateUserAccount.spec.js index 5909d616c..6f7abbca8 100644 --- a/webapp/components/Registration/CreateUserAccount.spec.js +++ b/webapp/components/Registration/CreateUserAccount.spec.js @@ -24,6 +24,9 @@ describe('CreateUserAccount', () => { loading: false, mutate: jest.fn(), }, + $i18n: { + locale: () => 'en', + }, } propsData = {} stubs = { @@ -69,12 +72,6 @@ describe('CreateUserAccount', () => { } }) - it('calls CreateUserAccount graphql mutation', async () => { - await action() - const expected = expect.objectContaining({ mutation: SignupVerificationMutation }) - expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected) - }) - it('delivers data to backend', async () => { await action() const expected = expect.objectContaining({ @@ -91,6 +88,12 @@ describe('CreateUserAccount', () => { expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected) }) + it('calls CreateUserAccount graphql mutation', async () => { + await action() + const expected = expect.objectContaining({ mutation: SignupVerificationMutation }) + expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected) + }) + describe('in case mutation resolves', () => { beforeEach(() => { mocks.$apollo.mutate = jest.fn().mockResolvedValue({ diff --git a/webapp/components/Registration/CreateUserAccount.vue b/webapp/components/Registration/CreateUserAccount.vue index c17302343..b8b20d146 100644 --- a/webapp/components/Registration/CreateUserAccount.vue +++ b/webapp/components/Registration/CreateUserAccount.vue @@ -70,22 +70,24 @@ :checked="termsAndConditionsConfirmed" /> -
- -
-- -
+