From fab594663131ad5f70335c6d5fa8782bba9261ba Mon Sep 17 00:00:00 2001 From: mahula Date: Mon, 30 Jan 2023 16:41:44 +0100 Subject: [PATCH] adapt unit tests to changes in user resolver's error message --- backend/src/graphql/resolver/EmailOptinCodes.test.ts | 2 +- backend/src/graphql/resolver/UserResolver.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/graphql/resolver/EmailOptinCodes.test.ts b/backend/src/graphql/resolver/EmailOptinCodes.test.ts index d7c0b9bd6..b1bef0618 100644 --- a/backend/src/graphql/resolver/EmailOptinCodes.test.ts +++ b/backend/src/graphql/resolver/EmailOptinCodes.test.ts @@ -96,7 +96,7 @@ describe('EmailOptinCodes', () => { mutate({ mutation: forgotPassword, variables: { email: 'peter@lustig.de' } }), ).resolves.toMatchObject({ data: null, - errors: [new GraphQLError('email already sent less than 10 minutes minutes ago')], + errors: [new GraphQLError('email already sent less than 10 minutes ago')], }) }) diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index 073bad04d..9060f2696 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -830,7 +830,7 @@ describe('UserResolver', () => { new GraphQLError( `email already sent less than ${printTimeDuration( CONFIG.EMAIL_CODE_REQUEST_TIME, - )} minutes ago`, + )} ago`, ), ], }), @@ -870,13 +870,13 @@ describe('UserResolver', () => { CONFIG.EMAIL_CODE_REQUEST_TIME = emailCodeRequestTime await expect(mutate({ mutation: forgotPassword, variables })).resolves.toEqual( expect.objectContaining({ - errors: [new GraphQLError('email already sent less than 10 minutes minutes ago')], + errors: [new GraphQLError('email already sent less than 10 minutes ago')], }), ) }) it('logs the error found', () => { - expect(logger.error).toBeCalledWith(`email already sent less than 10 minutes minutes ago`) + expect(logger.error).toBeCalledWith(`email already sent less than 10 minutes ago`) }) }) })