test for first event in ContributionLinkResolver

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

View File

@ -15,6 +15,8 @@ import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
import { peterLustig } from '@/seeds/users/peter-lustig'
import { userFactory } from '@/seeds/factory/user'
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
import { EventType } from '@/event/Event'
import { Event as DbEvent } from '@entity/Event'
let mutate: any, query: any, con: any
let testEnv: any
@ -566,6 +568,17 @@ describe('Contribution Links', () => {
)
})
it('stores the ADMIN_CONTRIBUTION_LINK_DELETE event in the database', async () => {
await expect(DbEvent.find()).resolves.toContainEqual(
expect.objectContaining({
type: EventType.ADMIN_CONTRIBUTION_LINK_DELETE,
affectedUserId: 0,
actingUserId: expect.any(Number),
involvedContributionLinkId: linkId,
}),
)
})
it('does not list this contribution link anymore', async () => {
await expect(query({ query: listContributionLinks })).resolves.toEqual(
expect.objectContaining({