From 7634234afd22e46267450eacc54077373ebbe6f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Wed, 2 Jan 2019 15:15:48 +0100 Subject: [PATCH] Match error message in tests with production code --- src/graphql-schema.js | 2 +- src/graphql-schema.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/graphql-schema.js b/src/graphql-schema.js index 830fda193..243d6b551 100644 --- a/src/graphql-schema.js +++ b/src/graphql-schema.js @@ -111,7 +111,7 @@ export const resolvers = { return Object.assign(currentUser, { token: generateJwt(currentUser) }) - } else throw new AuthenticationError('Incorrect username or password.') + } else throw new AuthenticationError('Incorrect email address or password.') }) } } diff --git a/src/graphql-schema.test.js b/src/graphql-schema.test.js index 6ce4658b9..52bbed901 100644 --- a/src/graphql-schema.test.js +++ b/src/graphql-schema.test.js @@ -55,21 +55,21 @@ describe.only('login', () => { }) describe('with a valid email but incorrect password', () => { - it('responds with "Wrong email/password combination"', async () => { + it('responds with "Incorrect email address or password."', async () => { try { await request(getHost(), mutation({email: 'test@example.org', password: 'wrong'})) } catch (error) { - expect(error.response.errors[0].message).toEqual('Wrong email/password combination') + expect(error.response.errors[0].message).toEqual('Incorrect email address or password.') } }) }) describe('with a non-existing email', () => { - it('responds with "Wrong email/password combination"', async () => { + it('responds with "Incorrect email address or password."', async () => { try { await request(getHost(), mutation({email: 'non-existent@example.org', password: 'wrong'})) } catch (error) { - expect(error.response.errors[0].message).toEqual('Wrong email/password combination') + expect(error.response.errors[0].message).toEqual('Incorrect email address or password.') } }) })