From 7583619058fff4eb3baf2f26c612bb4b32ef41c7 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 7 Mar 2023 11:49:04 +0100 Subject: [PATCH] test for the other two events --- .../resolver/ContributionLinkResolver.test.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/backend/src/graphql/resolver/ContributionLinkResolver.test.ts b/backend/src/graphql/resolver/ContributionLinkResolver.test.ts index ed56fd5af..3462a05a9 100644 --- a/backend/src/graphql/resolver/ContributionLinkResolver.test.ts +++ b/backend/src/graphql/resolver/ContributionLinkResolver.test.ts @@ -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), + }), + ) + }) }) })