mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test case deleted User
This commit is contained in:
parent
45a92e637a
commit
702a39af9a
@ -671,6 +671,40 @@ describe('UserResolver', () => {
|
||||
expect(logger.error).toBeCalledWith('No user with this credentials', variables.email)
|
||||
})
|
||||
})
|
||||
|
||||
describe('user is in database but deleted', () => {
|
||||
beforeAll(async () => {
|
||||
jest.clearAllMocks()
|
||||
const user = await userFactory(testEnv, bibiBloxberg)
|
||||
// Hint: softRemove does not soft-delete the email contact of this user
|
||||
await user.softRemove()
|
||||
result = await mutate({ mutation: login, variables })
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await cleanDB()
|
||||
})
|
||||
|
||||
it('returns an error', () => {
|
||||
expect(result).toEqual(
|
||||
expect.objectContaining({
|
||||
errors: [
|
||||
new GraphQLError('This user was permanently deleted. Contact support for questions'),
|
||||
],
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it('logs the error thrown', () => {
|
||||
expect(logger.error).toBeCalledWith(
|
||||
'This user was permanently deleted. Contact support for questions',
|
||||
expect.objectContaining({
|
||||
firstName: bibiBloxberg.firstName,
|
||||
lastName: bibiBloxberg.lastName,
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('logout', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user