ci(cypress): Add shipping cost test case (#6779)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
likhinbopanna
2024-12-10 16:51:49 +05:30
committed by GitHub
parent 9f0d8efa8d
commit 08ab3ad7a2
13 changed files with 419 additions and 3 deletions

View File

@ -1079,9 +1079,17 @@ Cypress.Commands.add(
createPaymentBody.setup_future_usage,
"setup_future_usage"
).to.equal(response.body.setup_future_usage);
expect(createPaymentBody.amount, "amount_capturable").to.equal(
response.body.amount_capturable
);
// If 'shipping_cost' is not included in the request, the 'amount' in 'createPaymentBody' should match the 'amount_capturable' in the response.
if (typeof createPaymentBody?.shipping_cost === "undefined") {
expect(createPaymentBody.amount, "amount_capturable").to.equal(
response.body.amount_capturable
);
} else {
expect(
createPaymentBody.amount + createPaymentBody.shipping_cost,
"amount_capturable"
).to.equal(response.body.amount_capturable);
}
expect(response.body.amount_received, "amount_received").to.be.oneOf([
0,
null,