From 5bbef05dddc364d6a67dc52b57a7b5a276c6b842 Mon Sep 17 00:00:00 2001 From: Georgi Parlakov Date: Sun, 29 Sep 2024 10:57:22 +0300 Subject: [PATCH] chore: add tests for campaign application file fetch --- .../campaign-application.service.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/src/campaign-application/campaign-application.service.spec.ts b/apps/api/src/campaign-application/campaign-application.service.spec.ts index d0c09359..09cbdda2 100644 --- a/apps/api/src/campaign-application/campaign-application.service.spec.ts +++ b/apps/api/src/campaign-application/campaign-application.service.spec.ts @@ -485,7 +485,9 @@ describe('CampaignApplicationService', () => { prismaMock.campaignApplication.findFirst.mockResolvedValue(mockSingleCampaignApplication) await expect( service.getFile('id', false, { ...mockPerson, organizer: { id: 'different-id' } }), - ).rejects.toThrow(new ForbiddenException('User is not admin or organizer of the campaignApplication')) + ).rejects.toThrow( + new ForbiddenException('User is not admin or organizer of the campaignApplication'), + ) }) it('should allow admin users to see files belonging to other users', async () => { @@ -496,7 +498,9 @@ describe('CampaignApplicationService', () => { } as File) await expect( service.getFile('id', true, { ...mockPerson, organizer: { id: 'different-id' } }), - ).resolves.not.toThrow(new ForbiddenException('User is not admin or organizer of the campaignApplication')) + ).resolves.not.toThrow( + new ForbiddenException('User is not admin or organizer of the campaignApplication'), + ) }) }) })