mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
ids are now checked in event creation
This commit is contained in:
parent
5f94cfca88
commit
1203dada61
@ -176,7 +176,7 @@ describe('UserResolver', () => {
|
||||
expect(EventProtocol.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.SEND_CONFIRMATION_EMAIL,
|
||||
userId: user.id,
|
||||
userId: user[0].id,
|
||||
}),
|
||||
)
|
||||
})
|
||||
@ -295,7 +295,7 @@ describe('UserResolver', () => {
|
||||
expect(EventProtocol.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.ACTIVATE_ACCOUNT,
|
||||
userId: expect.any(Number), // as it is randomly generated
|
||||
userId: user[0].id,
|
||||
}),
|
||||
)
|
||||
})
|
||||
@ -605,6 +605,8 @@ bei Gradidio sei dabei!`,
|
||||
})
|
||||
|
||||
describe('authenticated', () => {
|
||||
let user: User[]
|
||||
|
||||
const variables = {
|
||||
email: 'bibi@bloxberg.de',
|
||||
password: 'Aa12345_',
|
||||
@ -612,6 +614,7 @@ bei Gradidio sei dabei!`,
|
||||
|
||||
beforeAll(async () => {
|
||||
await query({ query: login, variables })
|
||||
user = await User.find()
|
||||
})
|
||||
|
||||
afterAll(() => {
|
||||
@ -643,7 +646,7 @@ bei Gradidio sei dabei!`,
|
||||
expect(EventProtocol.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.LOGIN,
|
||||
userId: expect.any(Number), // as it is randomly generated
|
||||
userId: user[0].id,
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
@ -622,9 +622,11 @@ export class UserResolver {
|
||||
})
|
||||
|
||||
await queryRunner.commitTransaction()
|
||||
|
||||
const eventActivateAccount = new EventActivateAccount()
|
||||
eventActivateAccount.userId = user.id
|
||||
eventProtocol.writeEvent(event.setEventActivateAccount(eventActivateAccount))
|
||||
|
||||
logger.info('User data written successfully...')
|
||||
} catch (e) {
|
||||
await queryRunner.rollbackTransaction()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user