Fix tests
This commit is contained in:
parent
e1279ffecd
commit
56567de04a
|
@ -48,7 +48,7 @@ describe("/api/global/users", () => {
|
||||||
400
|
400
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(res.body.message).toBe("Unavailable")
|
expect(res.body.message).toBe(`Unavailable`)
|
||||||
expect(sendMailMock).toHaveBeenCalledTimes(0)
|
expect(sendMailMock).toHaveBeenCalledTimes(0)
|
||||||
expect(code).toBeUndefined()
|
expect(code).toBeUndefined()
|
||||||
expect(events.user.invited).toBeCalledTimes(0)
|
expect(events.user.invited).toBeCalledTimes(0)
|
||||||
|
@ -225,7 +225,7 @@ describe("/api/global/users", () => {
|
||||||
|
|
||||||
const response = await config.api.users.saveUser(user, 400)
|
const response = await config.api.users.saveUser(user, 400)
|
||||||
|
|
||||||
expect(response.body.message).toBe(`Unavailable`)
|
expect(response.body.message).toBe(`Email already taken: '${user.email}'`)
|
||||||
expect(events.user.created).toBeCalledTimes(0)
|
expect(events.user.created).toBeCalledTimes(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -237,7 +237,9 @@ describe("/api/global/users", () => {
|
||||||
delete user._id
|
delete user._id
|
||||||
const response = await config.api.users.saveUser(user, 400)
|
const response = await config.api.users.saveUser(user, 400)
|
||||||
|
|
||||||
expect(response.body.message).toBe(`Unavailable`)
|
expect(response.body.message).toBe(
|
||||||
|
`Email already taken: '${user.email}'`
|
||||||
|
)
|
||||||
expect(events.user.created).toBeCalledTimes(0)
|
expect(events.user.created).toBeCalledTimes(0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -249,7 +251,7 @@ describe("/api/global/users", () => {
|
||||||
|
|
||||||
const response = await config.api.users.saveUser(user, 400)
|
const response = await config.api.users.saveUser(user, 400)
|
||||||
|
|
||||||
expect(response.body.message).toBe(`Unavailable`)
|
expect(response.body.message).toBe(`Email already taken: '${user.email}'`)
|
||||||
expect(events.user.created).toBeCalledTimes(0)
|
expect(events.user.created).toBeCalledTimes(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue