mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
Match error message in tests with production code
This commit is contained in:
parent
ffafd72c79
commit
7634234afd
@ -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.')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -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.')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user