@@ -77,4 +77,52 @@ describe(`paypal 3ds component happy path`, () => {
77
77
. render ( "body" ) ;
78
78
} ) ;
79
79
} ) ;
80
+
81
+ it ( "should render onClose if cancel" , ( ) => {
82
+ return wrapPromise ( ( { expect, avoid } ) => {
83
+ const nonce = "12345" ;
84
+ const userType = "UNBRANDED_GUEST" ;
85
+ window . contingencyResult = {
86
+ success : false ,
87
+ liability_shift : "NO" ,
88
+ status : "NO" ,
89
+ authentication_status_reason : "FAILURE" ,
90
+ pageID : "1234" ,
91
+ } ;
92
+ return window . paypal
93
+ . ThreeDomainSecure ( {
94
+ createOrder : ( ) => "XXXXXXXXXXXXXXXXX" ,
95
+ onSuccess : avoid ( "onSuccess" ) ,
96
+ onCancel : avoid ( "onCancel" ) ,
97
+ onError : avoid ( "onError" ) ,
98
+ onClose : expect ( "onClose" ) ,
99
+ nonce,
100
+ userType,
101
+ } )
102
+ . render ( "body" ) ;
103
+ } ) ;
104
+ } ) ;
105
+
106
+ it ( "should render onError " , ( ) => {
107
+ return wrapPromise ( ( { expect, avoid } ) => {
108
+ const nonce = "12345" ;
109
+ window . contingencyResult = {
110
+ success : false ,
111
+ liability_shift : "NO" ,
112
+ status : "NO" ,
113
+ authentication_status_reason : "FAILURE" ,
114
+ pageID : "1234" ,
115
+ } ;
116
+ return window . paypal
117
+ . ThreeDomainSecure ( {
118
+ createOrder : ( ) => "XXXXXXXXXXXXXXXXX" ,
119
+ onSuccess : avoid ( "onSuccess" ) ,
120
+ onCancel : avoid ( "onCancel" ) ,
121
+ onError : expect ( "onError" ) ,
122
+ onClose : avoid ( "onClose" ) ,
123
+ nonce,
124
+ } )
125
+ . render ( "body" ) ;
126
+ } ) ;
127
+ } ) ;
80
128
} ) ;
0 commit comments