Skip to content

Commit

Permalink
ensure typesafety
Browse files Browse the repository at this point in the history
  • Loading branch information
ravishekhar committed Dec 26, 2024
1 parent c86608f commit 6c1ecef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/integration/tests/pixel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ describe(`paypal button component resume flow`, () => {

it("should create a button instance with correct query params for resume flow and validate resume flow is true", (done) => {
done = once(done);
const location = window.location.href;
const url = new URL(location);
url.searchParams.set("buttonSessionID", buttonSessionID);
url.searchParams.set("orderID", orderID);
url.searchParams.set("fundingSource", fundingSource);
url.hash = "#onApprove";

history.pushState({}, "", url);
history.pushState({}, "", url.href);
const buttons = window.paypal.Buttons({
test: { flow: "popup", action: "checkout" },

Expand All @@ -74,13 +75,14 @@ describe(`paypal button component resume flow`, () => {

it("should create a resume flow with onApprove", (done) => {
done = once(done);
const location = window.location.href;
const url = new URL(location);
url.searchParams.set("buttonSessionID", buttonSessionID);
url.searchParams.set("orderID", orderID);
url.searchParams.set("fundingSource", fundingSource);
url.hash = "#onApprove";

history.pushState({}, "", url);
history.pushState({}, "", url.href);
const buttons = window.paypal.Buttons({
test: { action: "approve" },

Expand Down Expand Up @@ -113,13 +115,14 @@ describe(`paypal button component resume flow`, () => {

it("should create a resume flow with onError", (done) => {
done = once(done);
const location = window.location.href;
const url = new URL(location);
url.searchParams.set("buttonSessionID", buttonSessionID);
url.searchParams.set("orderID", orderID);
url.searchParams.set("fundingSource", fundingSource);
url.hash = "#onApprove";

history.pushState({}, "", url);
history.pushState({}, "", url.href);
const buttons = window.paypal.Buttons({
test: { action: "error" },

Expand Down

0 comments on commit 6c1ecef

Please sign in to comment.