From 4e5f115a25db408b5a34dc1a118531507bd532cb Mon Sep 17 00:00:00 2001 From: Aleksandar Petkov Date: Mon, 9 Dec 2024 12:32:05 +0200 Subject: [PATCH] chore: Fix tests --- apps/api/src/stripe/stripe.controller.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/api/src/stripe/stripe.controller.spec.ts b/apps/api/src/stripe/stripe.controller.spec.ts index e6690324..949b7786 100644 --- a/apps/api/src/stripe/stripe.controller.spec.ts +++ b/apps/api/src/stripe/stripe.controller.spec.ts @@ -29,7 +29,6 @@ import { NotificationModule } from '../sockets/notifications/notification.module import { KeycloakTokenParsed } from '../auth/keycloak' describe('StripeController', () => { let controller: StripeController - const idempotencyKey = 'test_123' const stripeMock = { checkout: { sessions: { create: jest.fn() } }, paymentIntents: { retrieve: jest.fn() }, @@ -212,7 +211,7 @@ describe('StripeController', () => { }, } - await expect(controller.updateSetupIntent('123', idempotencyKey, payload)).rejects.toThrow( + await expect(controller.updateSetupIntent('123', payload)).rejects.toThrow( new NotAcceptableException('Campaign cannot accept donations in state: complete'), ) }) @@ -228,7 +227,7 @@ describe('StripeController', () => { state: CampaignState.complete, title: 'active-campaign', } as Campaign) - await expect(controller.setupIntentToSubscription('123', idempotencyKey)).toResolve() + await expect(controller.setupIntentToSubscription('123')).toResolve() expect(stripeMock.setupIntents.retrieve).toHaveBeenCalledWith('123', { expand: ['payment_method'], })