mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
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:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user