mirror of
https://github.com/juspay/hyperswitch.git
synced 2026-03-13 09:02:06 +08:00
test(cypress): remove duplicate wallet spec 00041 (#11468)
This commit is contained in:
@@ -1,90 +0,0 @@
|
||||
import * as fixtures from "../../../fixtures/imports";
|
||||
import State from "../../../utils/State";
|
||||
import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
|
||||
|
||||
let globalState;
|
||||
|
||||
describe("Wallet tests", () => {
|
||||
afterEach("flush global state", () => {
|
||||
cy.task("setGlobalState", globalState.data);
|
||||
});
|
||||
|
||||
context("Bluecode Create and Confirm flow test", () => {
|
||||
let shouldContinue = true;
|
||||
|
||||
before("seed global state", () => {
|
||||
cy.task("getGlobalState").then((state) => {
|
||||
globalState = new State(state);
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
if (!shouldContinue) {
|
||||
this.skip();
|
||||
}
|
||||
});
|
||||
|
||||
it("create-payment-call-test", () => {
|
||||
const data = getConnectorDetails(globalState.get("connectorId"))[
|
||||
"wallet_pm"
|
||||
]["PaymentIntent"]("Bluecode");
|
||||
|
||||
cy.createPaymentIntentTest(
|
||||
fixtures.createPaymentBody,
|
||||
data,
|
||||
"three_ds",
|
||||
"automatic",
|
||||
globalState
|
||||
);
|
||||
if (shouldContinue) shouldContinue = utils.should_continue_further(data);
|
||||
});
|
||||
|
||||
it("payment_methods-call-test", () => {
|
||||
cy.paymentMethodsCallTest(globalState);
|
||||
});
|
||||
|
||||
it("Confirm wallet redirect", () => {
|
||||
const data = getConnectorDetails(globalState.get("connectorId"))[
|
||||
"wallet_pm"
|
||||
]["Bluecode"];
|
||||
|
||||
cy.confirmBankRedirectCallTest(
|
||||
fixtures.confirmBody,
|
||||
data,
|
||||
true,
|
||||
globalState
|
||||
);
|
||||
|
||||
if (shouldContinue) shouldContinue = utils.should_continue_further(data);
|
||||
});
|
||||
|
||||
it("Handle wallet redirection", () => {
|
||||
const expected_redirection = fixtures.confirmBody["return_url"];
|
||||
const payment_method_type = globalState.get("paymentMethodType");
|
||||
const nextActionUrl = globalState.get("nextActionUrl");
|
||||
|
||||
expect(
|
||||
nextActionUrl,
|
||||
"nextActionUrl should be defined before handling wallet redirection"
|
||||
).to.be.a("string");
|
||||
|
||||
cy.handleWalletRedirection(
|
||||
globalState,
|
||||
payment_method_type,
|
||||
expected_redirection
|
||||
);
|
||||
});
|
||||
|
||||
it("Sync payment status", () => {
|
||||
const data = getConnectorDetails(globalState.get("connectorId"))[
|
||||
"wallet_pm"
|
||||
]["Bluecode"];
|
||||
|
||||
cy.retrievePaymentCallTest({
|
||||
globalState,
|
||||
data,
|
||||
expectedIntentStatus: "requires_customer_action",
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user