test for the other two events

This commit is contained in:
Ulf Gebhardt 2023-03-07 11:49:04 +01:00
parent fa2916ef4d
commit 7583619058
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -247,6 +247,18 @@ describe('Contribution Links', () => {
)
})
it('stores the ADMIN_CONTRIBUTION_LINK_CREATE event in the database', async () => {
await expect(DbEvent.find()).resolves.toContainEqual(
expect.objectContaining({
type: EventType.ADMIN_CONTRIBUTION_LINK_CREATE,
affectedUserId: 0,
actingUserId: expect.any(Number),
involvedContributionLinkId: expect.any(Number),
amount: expect.decimalEqual(200),
}),
)
})
it('returns an error if missing startDate', async () => {
jest.clearAllMocks()
await expect(
@ -529,6 +541,18 @@ describe('Contribution Links', () => {
}),
)
})
it('stores the ADMIN_CONTRIBUTION_LINK_UPDATE event in the database', async () => {
await expect(DbEvent.find()).resolves.toContainEqual(
expect.objectContaining({
type: EventType.ADMIN_CONTRIBUTION_LINK_UPDATE,
affectedUserId: 0,
actingUserId: expect.any(Number),
involvedContributionLinkId: expect.any(Number),
amount: expect.decimalEqual(400),
}),
)
})
})
})