Skip to content

Commit

Permalink
fixed tests failing due to rename
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-grit committed Aug 28, 2023
1 parent 1de760c commit b7910ff
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions apps/api/src/donations/events/stripe-payment.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('StripePaymentService', () => {

const paymentData = getPaymentData(mockPaymentEventCreated.data.object as Stripe.PaymentIntent)

const mockedupdateDonationPayment = jest
const mockedUpdateDonationPayment = jest
.spyOn(campaignService, 'updateDonationPayment')
.mockImplementation(() => Promise.resolve(''))
.mockName('updateDonationPayment')
Expand All @@ -145,7 +145,7 @@ describe('StripePaymentService', () => {
.then(() => {
expect(mockedCampaignById).toHaveBeenCalledWith(campaignId) //campaignId from the Stripe Event
expect(mockedcreateDonationWish).not.toHaveBeenCalled()
expect(mockedupdateDonationPayment).toHaveBeenCalledWith(
expect(mockedUpdateDonationPayment).toHaveBeenCalledWith(
mockedCampaign,
paymentData,
DonationStatus.waiting,
Expand All @@ -170,7 +170,7 @@ describe('StripePaymentService', () => {
mockPaymentEventCancelled.data.object as Stripe.PaymentIntent,
)

const mockedupdateDonationPayment = jest
const mockedUpdateDonationPayment = jest
.spyOn(campaignService, 'updateDonationPayment')
.mockImplementation(() => Promise.resolve(''))
.mockName('updateDonationPayment')
Expand All @@ -183,7 +183,7 @@ describe('StripePaymentService', () => {
.expect(201)
.then(() => {
expect(mockedCampaignById).toHaveBeenCalledWith(campaignId) //campaignId from the Stripe Event
expect(mockedupdateDonationPayment).toHaveBeenCalledWith(
expect(mockedUpdateDonationPayment).toHaveBeenCalledWith(
mockedCampaign,
paymentData,
DonationStatus.cancelled,
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('StripePaymentService', () => {
.expect(201)
.then(() => {
expect(mockedCampaignById).toHaveBeenCalledWith(campaignId) //campaignId from the Stripe Event
expect(mockedupdateDonationPayment).toHaveBeenCalled()
expect(mockedUpdateDonationPayment).toHaveBeenCalled()
expect(prismaMock.donation.create).toHaveBeenCalled()
expect(mockedIncrementVaultAmount).toHaveBeenCalled()
expect(prismaMock.donation.update).toHaveBeenCalledWith({
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('StripePaymentService', () => {
)

jest.spyOn(prismaMock, '$transaction').mockImplementation((callback) => callback(prismaMock))
const mockedupdateDonationPayment = jest
const mockedUpdateDonationPayment = jest
.spyOn(campaignService, 'updateDonationPayment')
.mockName('updateDonationPayment')

Expand Down Expand Up @@ -334,7 +334,7 @@ describe('StripePaymentService', () => {
.expect(201)
.then(() => {
expect(mockedCampaignById).toHaveBeenCalledWith(campaignId) //campaignId from the Stripe Event
expect(mockedupdateDonationPayment).toHaveBeenCalled()
expect(mockedUpdateDonationPayment).toHaveBeenCalled()
expect(prismaMock.donation.create).toHaveBeenCalled()
expect(prismaMock.donation.update).not.toHaveBeenCalled()
expect(mockedIncrementVaultAmount).toHaveBeenCalled()
Expand Down Expand Up @@ -433,7 +433,7 @@ describe('StripePaymentService', () => {

jest.spyOn(prismaMock, '$transaction').mockImplementation((callback) => callback(prismaMock))

const mockedupdateDonationPayment = jest
const mockedUpdateDonationPayment = jest
.spyOn(campaignService, 'updateDonationPayment')
.mockName('updateDonationPayment')

Expand Down Expand Up @@ -465,7 +465,7 @@ describe('StripePaymentService', () => {
(mockCustomerSubscriptionCreated.data.object as Stripe.SubscriptionItem).metadata
.campaignId,
) //campaignId from the Stripe Event
expect(mockedupdateDonationPayment).toHaveBeenCalled()
expect(mockedUpdateDonationPayment).toHaveBeenCalled()
expect(mockedIncrementVaultAmount).toHaveBeenCalled()
})
})
Expand All @@ -489,7 +489,7 @@ describe('StripePaymentService', () => {
.spyOn(campaignService, 'getCampaignById')
.mockImplementation(() => Promise.resolve(mockedCampaignCompeleted))

const mockedupdateDonationPayment = jest
const mockedUpdateDonationPayment = jest
.spyOn(campaignService, 'updateDonationPayment')
.mockImplementation(() => Promise.resolve(''))
.mockName('updateDonationPayment')
Expand All @@ -509,7 +509,7 @@ describe('StripePaymentService', () => {
(mockCustomerSubscriptionCreated.data.object as Stripe.SubscriptionItem).metadata
.campaignId,
) //campaignId from the Stripe Event
expect(mockedupdateDonationPayment).toHaveBeenCalled()
expect(mockedUpdateDonationPayment).toHaveBeenCalled()
expect(mockCancelSubscription).toHaveBeenCalledWith(
mockedRecurringDonation.extSubscriptionId,
)
Expand Down

0 comments on commit b7910ff

Please sign in to comment.