Skip to content

Commit a3987d3

Browse files
author
Hai-Yen Nguyen
committed
adding test for onClose and onError
1 parent 77d9cb3 commit a3987d3

File tree

1 file changed

+48
-0
lines changed
  • test/integration/tests/three-domain-secure

1 file changed

+48
-0
lines changed

test/integration/tests/three-domain-secure/happy.js

+48
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,52 @@ describe(`paypal 3ds component happy path`, () => {
7777
.render("body");
7878
});
7979
});
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+
});
80128
});

0 commit comments

Comments
 (0)