@@ -26,31 +26,25 @@ describe("app switch resume flow", () => {
2626
2727 test ( "should test fetching resume params when parameters are correctly passed" , ( ) => {
2828 vi . spyOn ( window , "location" , "get" ) . mockReturnValue ( {
29- hash : "#onApprove" ,
30- search : `buttonSessionID=${ buttonSessionID } &orderID=${ orderID } &fundingSource=${ fundingSource } ` ,
29+ hash : `#onApprove?buttonSessionID=${ buttonSessionID } &token=${ orderID } &fundingSource=${ fundingSource } ` ,
3130 } ) ;
3231
3332 const params = getAppSwitchResumeParams ( ) ;
3433
3534 expect . assertions ( 2 ) ;
3635 expect ( params ) . toEqual ( {
37- billingToken : null ,
3836 buttonSessionID,
3937 checkoutState : "onApprove" ,
4038 fundingSource,
4139 orderID,
42- payerID : null ,
43- paymentID : null ,
44- subscriptionID : null ,
45- vaultSetupToken : null ,
4640 } ) ;
4741 expect ( isAppSwitchResumeFlow ( ) ) . toEqual ( true ) ;
4842 } ) ;
4943
5044 test ( "should test fetching resume params with invalid callback passed" , ( ) => {
5145 vi . spyOn ( window , "location" , "get" ) . mockReturnValue ( {
5246 hash : "#Unknown" ,
53- search : `buttonSessionID=${ buttonSessionID } &orderID =${ orderID } &fundingSource=${ fundingSource } ` ,
47+ search : `buttonSessionID=${ buttonSessionID } &token =${ orderID } &fundingSource=${ fundingSource } ` ,
5448 } ) ;
5549
5650 const params = getAppSwitchResumeParams ( ) ;
@@ -62,8 +56,7 @@ describe("app switch resume flow", () => {
6256
6357 test ( "should test null fetching resume params with invalid callback passed" , ( ) => {
6458 vi . spyOn ( window , "location" , "get" ) . mockReturnValue ( {
65- hash : "#Unknown" ,
66- search : `buttonSessionID=${ buttonSessionID } &orderID=${ orderID } &fundingSource=${ fundingSource } ` ,
59+ hash : `#Unknown?buttonSessionID=${ buttonSessionID } &token=${ orderID } &fundingSource=${ fundingSource } ` ,
6760 } ) ;
6861
6962 const params = getAppSwitchResumeParams ( ) ;
@@ -73,10 +66,9 @@ describe("app switch resume flow", () => {
7366 expect ( isAppSwitchResumeFlow ( ) ) . toEqual ( false ) ;
7467 } ) ;
7568
76- test ( "should test fetching resume params when parameters are correctly passed" , ( ) => {
69+ test ( "should test fetching multiple resume params when parameters are correctly passed" , ( ) => {
7770 vi . spyOn ( window , "location" , "get" ) . mockReturnValue ( {
78- hash : "#onApprove" ,
79- search : `buttonSessionID=${ buttonSessionID } &orderID=${ orderID } &fundingSource=${ fundingSource } &billingToken=BA-124&payerID=PP-122&paymentID=PAY-123&subscriptionID=I-1234&vaultSetupToken=VA-3` ,
71+ hash : `#onApprove?buttonSessionID=${ buttonSessionID } &token=${ orderID } &fundingSource=${ fundingSource } &billingToken=BA-124&PayerID=PP-payer-122&paymentID=PAY-123&subscriptionID=I-1234&vaultSetupToken=VA-3` ,
8072 } ) ;
8173
8274 const params = getAppSwitchResumeParams ( ) ;
@@ -88,7 +80,7 @@ describe("app switch resume flow", () => {
8880 checkoutState : "onApprove" ,
8981 fundingSource,
9082 orderID,
91- payerID : "PP-122" ,
83+ payerID : "PP-payer- 122" ,
9284 paymentID : "PAY-123" ,
9385 subscriptionID : "I-1234" ,
9486 vaultSetupToken : "VA-3" ,
0 commit comments