Skip to content

fix: Generate Stripe idempotency keys server-side #1993

fix: Generate Stripe idempotency keys server-side

fix: Generate Stripe idempotency keys server-side #1993

GitHub Actions / JEST Tests failed Dec 9, 2024 in 1s

326 passed, 2 failed and 0 skipped

Tests failed

❌ test-results.xml

328 tests were completed in 21s with 326 passed, 2 failed and 0 skipped.

Test suite Passed Failed Skipped Time
AccountController 2✅ 581ms
AccountService 1✅ 521ms
AffiliateController 10✅ 1s
AffiliateService 1✅ 333ms
AppController 1✅ 211ms
AppService 1✅ 180ms
AuthService 20✅ 2s
BankaccountController 1✅ 534ms
BankaccountService 1✅ 256ms
BankTransactionsController 4✅ 994ms
BankTransactionsFileController 1✅ 1s
BankTransactionsFileService 1✅ 623ms
BankTransactionsService 1✅ 551ms
BenefactorController 1✅ 309ms
BenefactorService 1✅ 193ms
BeneficiaryController 8✅ 571ms
BeneficiaryService 1✅ 166ms
CampaignApplicationController 10✅ 864ms
CampaignApplicationService 25✅ 2s
CampaignController 18✅ 2s
CampaignFileController 4✅ 1s
CampaignFileService 1✅ 554ms
CampaignFileService 1✅ 648ms
CampaignNewsController 1✅ 389ms
CampaignNewsFileController 9✅ 1s
CampaignNewsService 1✅ 652ms
CampaignService 2✅ 509ms
CampaignTypesController 7✅ 364ms
CampaignTypesService 1✅ 195ms
CityController 7✅ 429ms
CityService 1✅ 165ms
CompanyController 1✅ 275ms
CompanyService 1✅ 195ms
CoordinatorController 5✅ 394ms
CoordinatorService 4✅ 218ms
CountryController 8✅ 498ms
CountryService 1✅ 179ms
DonationsController 4✅ 1s
DonationsService 1✅ 649ms
DonationWishController 1✅ 275ms
DonationWishService 1✅ 161ms
EmailService enabled 7✅ 546ms
ExpensesController 7✅ 1s
ExpensesService 1✅ 323ms
HealthController 1✅ 279ms
ImportTransactionsTask 15✅ 4s
ImportTransactionsTask 2✅ 714ms
InfoRequestController 1✅ 445ms
InfoRequestService 1✅ 342ms
IrregularityController 1✅ 490ms
IrregularityFileController 1✅ 551ms
IrregularityFileService 1✅ 407ms
IrregularityService 1✅ 357ms
LoginController 2✅ 803ms
MarketingNotificationsController 23✅ 5s
OrganizerController 1✅ 267ms
OrganizerService 1✅ 227ms
PaypalController 1✅ 1s
PaypalService 1✅ 702ms
PersonController 1✅ 470ms
PersonService with enable client list 5✅ 560ms
podkrepiTypes 1✅ 81ms
PrismaService 1✅ 173ms
ProviderLoginController 2✅ 504ms
RecurringDonationController 1✅ 352ms
RecurringDonationService 5✅ 454ms
RefreshController 2✅ 537ms
RegisterController 2✅ 777ms
StripeController 5✅ 2❌ 1s
StripePaymentService 15✅ 6s
StripeService 2✅ 702ms
SupportController 3✅ 802ms
SupportService 1✅ 366ms
Template service 1✅ 675ms
TransferController 11✅ 765ms
TransferService 1✅ 182ms
VaultController 8✅ 672ms
VaultService 4✅ 803ms
WithdrawalController 15✅ 1s
WithdrawalService 1✅ 475ms

❌ StripeController

StripeController should be defined
  ✅ StripeController should be defined
StripeController createCheckoutSession should create stripe session for active campaign
  ✅ StripeController createCheckoutSession should create stripe session for active campaign
StripeController createCheckoutSession should not create stripe session for completed campaign
  ✅ StripeController createCheckoutSession should not create stripe session for completed campaign
StripeController createCheckoutSession should create stripe session for completed campaign if allowed
  ✅ StripeController createCheckoutSession should create stripe session for completed campaign if allowed
StripeController should request refund for donation
  ✅ StripeController should request refund for donation
StripeController should not call setupintents.update if no campaignId is provided
  ❌ StripeController should not call setupintents.update if no campaignId is provided
	Error: expect(received).rejects.toThrow(expected)
StripeController should  subscription without creating new customer,products
  ❌ StripeController should  subscription without creating new customer,products
	Error: expect(received).toResolve()

Annotations

Check failure on line 37 in apps/api/src/stripe/stripe.service.ts

See this annotation in the file changed.

@github-actions github-actions / JEST Tests

StripeController ► StripeController should not call setupintents.update if no campaignId is provided ► StripeController should not call setupintents.update if no campaignId is provided

Failed test found in:
  test-results.xml
Error:
  Error: expect(received).rejects.toThrow(expected)
Raw output
Error: expect(received).rejects.toThrow(expected)

Expected message: "Campaign cannot accept donations in state: complete"
Received message: "Cannot read properties of undefined (reading 'campaignId')"

      35 |     inputDto: UpdateSetupIntentDto,
      36 |   ): Promise<Stripe.Response<Stripe.SetupIntent>> {
    > 37 |     if (!inputDto.metadata.campaignId)
         |                            ^
      38 |       throw new BadRequestException('campaignId is missing from metadata')
      39 |     await this.campaignService.validateCampaignId(
      40 |       inputDto.metadata.campaignId as string,

      at StripeService.updateSetupIntent (apps/api/src/stripe/stripe.service.ts:37:28)
      at StripeController.updateSetupIntent (apps/api/src/stripe/stripe.controller.ts:82:31)
      at Object.<anonymous> (apps/api/src/stripe/stripe.controller.spec.ts:215:29)
    at Object.toThrow (/home/runner/work/api/api/node_modules/expect/build/index.js:210:22)
    at Object.<anonymous> (/home/runner/work/api/api/apps/api/src/stripe/stripe.controller.spec.ts:215:88)
    at Promise.then.completed (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/utils.js:293:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/utils.js:226:10)
    at _callCircusTest (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:297:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:233:3)
    at _runTestsForDescribeBlock (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:135:9)
    at _runTestsForDescribeBlock (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:130:9)
    at run (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:68:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/api/api/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/api/api/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/runner/work/api/api/node_modules/jest-runner/build/testWorker.js:106:12)

Check failure on line 0 in test-results.xml

See this annotation in the file changed.

@github-actions github-actions / JEST Tests

StripeController ► StripeController should subscription without creating new customer,products ► StripeController should subscription without creating new customer,products

Failed test found in:
  test-results.xml
Error:
  Error: expect(received).toResolve()
Raw output
Error: expect(received).toResolve()

Expected promise to resolve, however it rejected.

    at Object.<anonymous> (/home/runner/work/api/api/apps/api/src/stripe/stripe.controller.spec.ts:231:79)
    at Promise.then.completed (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/utils.js:293:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/utils.js:226:10)
    at _callCircusTest (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:297:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:233:3)
    at _runTestsForDescribeBlock (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:135:9)
    at _runTestsForDescribeBlock (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:130:9)
    at run (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/run.js:68:3)
    at runAndTransformResultsToJestFormat (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/home/runner/work/api/api/node_modules/@jest/core/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/home/runner/work/api/api/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/home/runner/work/api/api/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/home/runner/work/api/api/node_modules/jest-runner/build/testWorker.js:106:12)