Repository: juspay/hyperswitch
File: cypress-tests/cypress/e2e/spec/Payment/00029-IncrementalAuth.cy.js (JavaScript)

Code before:
    it("[Payment] Confirm Payment Intent", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["SaveCardUseNo3DSManualCaptureOffSession"];

      cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);

      if (shouldContinue) shouldContinue = utils.should_continue_further(data);
    });
    it("[Payment] Incremental Authorization", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["IncrementalAuth"];
      cy.incrementalAuth(globalState, data);

      if (shouldContinue) shouldContinue = utils.should_continue_further(data);
    });
    it("[Payment] Capture Payment Intent", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["Capture"];

      const newData = {
        ...data,
        Request: { amount_to_capture: data.Request.amount_to_capture + 2000 },
        Response: getConnectorDetails(data, "ResponseCustom"),
      };

      cy.captureCallTest(fixtures.captureBody, newData, globalState);

      if (shouldContinue) shouldContinue = utils.should_continue_further(data);
    });
  });

  context("[Payment] [Saved Card] Incremental Pre-Auth", () => {
    let shouldContinue = true;

    beforeEach(function () {
      if (!shouldContinue || connector !== "cybersource") {
        this.skip();
      }
    });

    it("[Payment] List customer payment methods", () => {
      cy.listCustomerPMCallTest(globalState);
    });
    it("[Payment] Create Payment Intent", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["PaymentIntentOffSession"];


Review comment (suggestion):
This would not work, if you log `getConnectorDetails(data, "ResponseCustom")` in the console to see it, it would log 

<img width="200" src="https://github.com/user-attachments/assets/b1aea6de-b77e-4f85-9d3b-884f6c5a52ec" />

_Note: This image is not for `paypal`, I was exploring and working with something else, so just tried out the statement and provided a quick screenshot_

Code after:
    it("[Payment] Confirm Payment Intent", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["SaveCardUseNo3DSManualCaptureOffSession"];

      cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);

      if (shouldContinue) shouldContinue = utils.should_continue_further(data);
    });
    it("[Payment] Incremental Authorization", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["IncrementalAuth"];
      cy.incrementalAuth(globalState, data);

      if (shouldContinue) shouldContinue = utils.should_continue_further(data);
    });
    it("[Payment] Capture Payment Intent", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["Capture"];

      const newData = {
        ...data,
        Request: { amount_to_capture: data.Request.amount_to_capture + 2000 },
        Response: data.ResponseCustom || data.Response,
      };

      cy.captureCallTest(fixtures.captureBody, newData, globalState);

      if (shouldContinue) shouldContinue = utils.should_continue_further(data);
    });
  });

  context("[Payment] [Saved Card] Incremental Pre-Auth", () => {
    let shouldContinue = true;

    beforeEach(function () {
      if (!shouldContinue || connector !== "cybersource") {
        this.skip();
      }
    });

    it("[Payment] List customer payment methods", () => {
      cy.listCustomerPMCallTest(globalState);
    });
    it("[Payment] Create Payment Intent", () => {
      const data = getConnectorDetails(globalState.get("connectorId"))[
        "card_pm"
      ]["PaymentIntentOffSession"];