adapt unit tests to changes in user resolver's error message

This commit is contained in:
mahula 2023-01-30 16:41:44 +01:00
parent cbd8895acf
commit fab5946631
2 changed files with 4 additions and 4 deletions

View File

@ -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')],
})
})

View File

@ -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`)
})
})
})