From fa2916ef4df08ab62fae31b7e3069cc6c0de3cf8 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 7 Mar 2023 11:41:59 +0100 Subject: [PATCH] test for first event in ContributionLinkResolver --- .../resolver/ContributionLinkResolver.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/src/graphql/resolver/ContributionLinkResolver.test.ts b/backend/src/graphql/resolver/ContributionLinkResolver.test.ts index 3c95db047..ed56fd5af 100644 --- a/backend/src/graphql/resolver/ContributionLinkResolver.test.ts +++ b/backend/src/graphql/resolver/ContributionLinkResolver.test.ts @@ -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({