From 46cd21db1fbb1c05552d71ad76c2556303238146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 15 Jul 2019 19:35:07 +0200 Subject: [PATCH] Fix registration.spec --- backend/src/schema/resolvers/registration.spec.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/backend/src/schema/resolvers/registration.spec.js b/backend/src/schema/resolvers/registration.spec.js index 1cf3a13bb..dc2e96348 100644 --- a/backend/src/schema/resolvers/registration.spec.js +++ b/backend/src/schema/resolvers/registration.spec.js @@ -192,16 +192,16 @@ describe('SignupByInvitation', () => { describe('creates a EmailAddress node', () => { it('with a `createdAt` attribute', async () => { await action() - const emailAddresses = await instance.all('EmailAddress') - const emailAddress = await emailAddresses.first().toJson() + let emailAddress = await instance.first('EmailAddress', { email: 'someuser@example.org' }) + emailAddress = await emailAddress.toJson() expect(emailAddress.createdAt).toBeTruthy() expect(Date.parse(emailAddress.createdAt)).toEqual(expect.any(Number)) }) it('with a cryptographic `nonce`', async () => { await action() - const emailAddresses = await instance.all('EmailAddress') - const emailAddress = await emailAddresses.first().toJson() + let emailAddress = await instance.first('EmailAddress', { email: 'someuser@example.org' }) + emailAddress = await emailAddress.toJson() expect(emailAddress.nonce).toEqual(expect.any(String)) }) @@ -221,6 +221,7 @@ describe('SignupByInvitation', () => { it('rejects because codes can be used only once', async done => { await action() try { + variables.email = 'yetanotheremail@example.org' await action() } catch (e) { expect(e.message).toMatch(/Invitation code already used/) @@ -283,8 +284,8 @@ describe('Signup', () => { it('creates a Signup with a cryptographic `nonce`', async () => { await action() - const emailAddresses = await instance.all('EmailAddress') - const emailAddress = await emailAddresses.first().toJson() + let emailAddress = await instance.first('EmailAddress', { email: 'someuser@example.org' }) + emailAddress = await emailAddress.toJson() expect(emailAddress.nonce).toEqual(expect.any(String)) }) })