@@ -356,11 +356,8 @@ describe('GraphQLBillingNew', () => {
356356 expect ( result . plan . monthlyCharge ) . toBe ( 1000 ) ;
357357 expect ( result . chargeAmount ) . toBe ( 750 ) ;
358358 expect ( result . promo ) . toMatchObject ( {
359- id : promoCodeId . toString ( ) ,
360- benefitType : 'percent_discount' ,
361359 originalAmount : 1000 ,
362360 finalAmount : 750 ,
363- discountAmount : 250 ,
364361 } ) ;
365362
366363 const checksumData = checksumService . parseAndVerifyChecksum ( result . checksum ) ;
@@ -566,8 +563,7 @@ describe('GraphQLBillingNew', () => {
566563 jest . clearAllMocks ( ) ;
567564 } ) ;
568565
569- it ( 'should charge discounted amount and set full recurrent amount from checksum promo id' , async ( ) => {
570- const promoCodeId = new ObjectId ( ) ;
566+ it ( 'should charge full plan amount for recurrent payment' , async ( ) => {
571567 const userId = new ObjectId ( ) . toString ( ) ;
572568 const workspaceId = new ObjectId ( ) . toString ( ) ;
573569 const cardId = 'card-1' ;
@@ -587,9 +583,6 @@ describe('GraphQLBillingNew', () => {
587583 tariffPlanId : newPlanId . toString ( ) ,
588584 shouldSaveCard : false ,
589585 nextPaymentDate : new Date ( ) . toISOString ( ) ,
590- promo : {
591- id : promoCodeId . toString ( ) ,
592- } ,
593586 } ) ;
594587 const dueDate = new Date ( ) ;
595588 dueDate . setMonth ( dueDate . getMonth ( ) + 1 ) ;
@@ -626,21 +619,8 @@ describe('GraphQLBillingNew', () => {
626619 getBusinessOperationByTransactionId : jest . fn ( ) . mockResolvedValue ( { _id : new ObjectId ( ) } ) ,
627620 } as any ,
628621 releasesFactory : { } as any ,
629- promoCodesFactory : {
630- findOne : jest . fn ( ) . mockResolvedValue ( {
631- _id : promoCodeId ,
632- value : 'SAVE25' ,
633- benefit : {
634- type : 'percent_discount' ,
635- percent : 25 ,
636- } ,
637- } ) ,
638- } as any ,
639- promoCodeUsagesFactory : {
640- countByPromoCodeId : jest . fn ( ) . mockResolvedValue ( 0 ) ,
641- findByPromoCodeAndUser : jest . fn ( ) . mockResolvedValue ( null ) ,
642- findByPromoCodeAndWorkspace : jest . fn ( ) . mockResolvedValue ( null ) ,
643- } as any ,
622+ promoCodesFactory : { } as any ,
623+ promoCodeUsagesFactory : { } as any ,
644624 } ,
645625 } ;
646626
@@ -664,7 +644,7 @@ describe('GraphQLBillingNew', () => {
664644
665645 expect ( cloudPaymentsApi . payByToken ) . toHaveBeenCalledWith (
666646 expect . objectContaining ( {
667- Amount : 750 ,
647+ Amount : 1000 ,
668648 JsonData : expect . objectContaining ( {
669649 cloudPayments : expect . objectContaining ( {
670650 recurrent : expect . objectContaining ( {
0 commit comments