From 73bee57d156b8f90dc319a3130c3d4cd538522a3 Mon Sep 17 00:00:00 2001 From: "hyperswitch-bot[bot]" <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 15:01:04 +0000 Subject: [PATCH] chore(cypress): run formatter and address lints --- .../spec/Platform/00001-PlatformSetup.cy.js | 18 +- .../spec/Platform/00002-ProfileSetup.cy.js | 10 +- .../spec/Platform/00003-ConnectorSetup.cy.js | 6 +- .../spec/Platform/00004-CustomerFlows.cy.js | 177 +++++++++--------- 4 files changed, 113 insertions(+), 98 deletions(-) diff --git a/cypress-tests/cypress/e2e/spec/Platform/00001-PlatformSetup.cy.js b/cypress-tests/cypress/e2e/spec/Platform/00001-PlatformSetup.cy.js index 847bf68b54..817799ab1c 100644 --- a/cypress-tests/cypress/e2e/spec/Platform/00001-PlatformSetup.cy.js +++ b/cypress-tests/cypress/e2e/spec/Platform/00001-PlatformSetup.cy.js @@ -184,8 +184,14 @@ describe("Platform Setup & Connected Merchant Onboarding", () => { "merchant_account_type", "standard" ); - globalState.set("standardMerchantId_PlatformKey", response.body.merchant_id); - globalState.set("profileId_SM_PlatformKey", response.body.default_profile); + globalState.set( + "standardMerchantId_PlatformKey", + response.body.merchant_id + ); + globalState.set( + "profileId_SM_PlatformKey", + response.body.default_profile + ); } ); @@ -198,7 +204,10 @@ describe("Platform Setup & Connected Merchant Onboarding", () => { const savedMerchantId = globalState.get("merchantId"); const savedApiKey = globalState.get("apiKey"); const savedAdminApiKey = globalState.get("adminApiKey"); - globalState.set("merchantId", globalState.get("standardMerchantId_PlatformKey")); + globalState.set( + "merchantId", + globalState.get("standardMerchantId_PlatformKey") + ); globalState.set("adminApiKey", savedApiKey); cy.apiKeyCreateTest(fixtures.apiKeyCreateBody, globalState); @@ -244,7 +253,8 @@ describe("Platform Setup & Connected Merchant Onboarding", () => { expect(sm.merchant_account_type).to.equal("standard"); const smPlatformKey = response.body.find( - (m) => m.merchant_id === globalState.get("standardMerchantId_PlatformKey") + (m) => + m.merchant_id === globalState.get("standardMerchantId_PlatformKey") ); expect(smPlatformKey).to.exist; expect(smPlatformKey.merchant_account_type).to.equal("standard"); diff --git a/cypress-tests/cypress/e2e/spec/Platform/00002-ProfileSetup.cy.js b/cypress-tests/cypress/e2e/spec/Platform/00002-ProfileSetup.cy.js index 813ddad571..0fc3c219f2 100644 --- a/cypress-tests/cypress/e2e/spec/Platform/00002-ProfileSetup.cy.js +++ b/cypress-tests/cypress/e2e/spec/Platform/00002-ProfileSetup.cy.js @@ -42,7 +42,10 @@ describe("Profile Setup for Merchants", () => { globalState.set("merchantId", globalState.get("connectedMerchantId_1")); globalState.set("apiKey", globalState.get("apiKey_CM1")); - cy.createBusinessProfileTest(fixtures.businessProfile.bpCreate, globalState); + cy.createBusinessProfileTest( + fixtures.businessProfile.bpCreate, + globalState + ); cy.then(() => { globalState.set("profileId_CM1_New", globalState.get("profileId")); @@ -102,7 +105,10 @@ describe("Profile Setup for Merchants", () => { globalState.set("merchantId", globalState.get("standardMerchantId")); globalState.set("apiKey", globalState.get("apiKey_SM")); - cy.createBusinessProfileTest(fixtures.businessProfile.bpCreate, globalState); + cy.createBusinessProfileTest( + fixtures.businessProfile.bpCreate, + globalState + ); cy.then(() => { globalState.set("profileId_SM_New", globalState.get("profileId")); diff --git a/cypress-tests/cypress/e2e/spec/Platform/00003-ConnectorSetup.cy.js b/cypress-tests/cypress/e2e/spec/Platform/00003-ConnectorSetup.cy.js index d1171de5ef..43872a1d5e 100644 --- a/cypress-tests/cypress/e2e/spec/Platform/00003-ConnectorSetup.cy.js +++ b/cypress-tests/cypress/e2e/spec/Platform/00003-ConnectorSetup.cy.js @@ -166,10 +166,7 @@ describe("Connector Setup for Connected Merchants", () => { globalState.set("merchantId", globalState.get("standardMerchantId")); globalState.set("apiKey", globalState.get("apiKey_SM")); - globalState.set( - "merchantConnectorId", - globalState.get("connectorId_SM") - ); + globalState.set("merchantConnectorId", globalState.get("connectorId_SM")); globalState.set("connectorId", "stripe"); cy.connectorRetrieveCall(globalState); @@ -190,7 +187,6 @@ describe("Connector Setup for Connected Merchants", () => { expect(connectorIdCM1).to.not.equal(connectorIdCM2); }); - }); context("Platform Merchant Cannot Create Connector", () => { diff --git a/cypress-tests/cypress/e2e/spec/Platform/00004-CustomerFlows.cy.js b/cypress-tests/cypress/e2e/spec/Platform/00004-CustomerFlows.cy.js index a944cca4b4..61f00eff62 100644 --- a/cypress-tests/cypress/e2e/spec/Platform/00004-CustomerFlows.cy.js +++ b/cypress-tests/cypress/e2e/spec/Platform/00004-CustomerFlows.cy.js @@ -114,108 +114,111 @@ describe("Platform Customer Flows", () => { }); }); - context("Standard Merchant Creates Customer - Only Accessible by Standard", () => { - it("standard-merchant-creates-customer", () => { - const savedApiKey = globalState.get("apiKey"); - const savedMerchantId = globalState.get("merchantId"); - globalState.set("apiKey", globalState.get("apiKey_SM")); - globalState.set("merchantId", globalState.get("standardMerchantId")); + context( + "Standard Merchant Creates Customer - Only Accessible by Standard", + () => { + it("standard-merchant-creates-customer", () => { + const savedApiKey = globalState.get("apiKey"); + const savedMerchantId = globalState.get("merchantId"); + globalState.set("apiKey", globalState.get("apiKey_SM")); + globalState.set("merchantId", globalState.get("standardMerchantId")); - cy.createCustomerCallTest(fixtures.customerCreateBody, globalState); + cy.createCustomerCallTest(fixtures.customerCreateBody, globalState); - cy.then(() => { - globalState.set( - "customerId_SM_Created", - globalState.get("customerId") - ); - globalState.set("apiKey", savedApiKey); - globalState.set("merchantId", savedMerchantId); - }); - }); - - it("verify-platform-merchant-cannot-access-standard-customer", () => { - const savedApiKey = globalState.get("apiKey"); - const savedCustomerId = globalState.get("customerId"); - globalState.set("customerId", globalState.get("customerId_SM_Created")); - - cy.request({ - method: "GET", - url: `${globalState.get("baseUrl")}/customers/${globalState.get("customerId")}`, - headers: { - "Content-Type": "application/json", - "api-key": globalState.get("apiKey"), - }, - failOnStatusCode: false, - }).then((response) => { - expect(response.status).to.equal(404); + cy.then(() => { + globalState.set( + "customerId_SM_Created", + globalState.get("customerId") + ); + globalState.set("apiKey", savedApiKey); + globalState.set("merchantId", savedMerchantId); + }); }); - cy.then(() => { - globalState.set("apiKey", savedApiKey); - globalState.set("customerId", savedCustomerId); - }); - }); + it("verify-platform-merchant-cannot-access-standard-customer", () => { + const savedApiKey = globalState.get("apiKey"); + const savedCustomerId = globalState.get("customerId"); + globalState.set("customerId", globalState.get("customerId_SM_Created")); - it("verify-connected-merchant-1-cannot-access-standard-customer", () => { - const savedApiKey = globalState.get("apiKey"); - const savedCustomerId = globalState.get("customerId"); - globalState.set("apiKey", globalState.get("apiKey_CM1")); - globalState.set("customerId", globalState.get("customerId_SM_Created")); + cy.request({ + method: "GET", + url: `${globalState.get("baseUrl")}/customers/${globalState.get("customerId")}`, + headers: { + "Content-Type": "application/json", + "api-key": globalState.get("apiKey"), + }, + failOnStatusCode: false, + }).then((response) => { + expect(response.status).to.equal(404); + }); - cy.request({ - method: "GET", - url: `${globalState.get("baseUrl")}/customers/${globalState.get("customerId")}`, - headers: { - "Content-Type": "application/json", - "api-key": globalState.get("apiKey"), - }, - failOnStatusCode: false, - }).then((response) => { - expect(response.status).to.equal(404); + cy.then(() => { + globalState.set("apiKey", savedApiKey); + globalState.set("customerId", savedCustomerId); + }); }); - cy.then(() => { - globalState.set("apiKey", savedApiKey); - globalState.set("customerId", savedCustomerId); - }); - }); + it("verify-connected-merchant-1-cannot-access-standard-customer", () => { + const savedApiKey = globalState.get("apiKey"); + const savedCustomerId = globalState.get("customerId"); + globalState.set("apiKey", globalState.get("apiKey_CM1")); + globalState.set("customerId", globalState.get("customerId_SM_Created")); - it("verify-connected-merchant-2-cannot-access-standard-customer", () => { - const savedApiKey = globalState.get("apiKey"); - const savedCustomerId = globalState.get("customerId"); - globalState.set("apiKey", globalState.get("apiKey_CM2")); - globalState.set("customerId", globalState.get("customerId_SM_Created")); + cy.request({ + method: "GET", + url: `${globalState.get("baseUrl")}/customers/${globalState.get("customerId")}`, + headers: { + "Content-Type": "application/json", + "api-key": globalState.get("apiKey"), + }, + failOnStatusCode: false, + }).then((response) => { + expect(response.status).to.equal(404); + }); - cy.request({ - method: "GET", - url: `${globalState.get("baseUrl")}/customers/${globalState.get("customerId")}`, - headers: { - "Content-Type": "application/json", - "api-key": globalState.get("apiKey"), - }, - failOnStatusCode: false, - }).then((response) => { - expect(response.status).to.equal(404); + cy.then(() => { + globalState.set("apiKey", savedApiKey); + globalState.set("customerId", savedCustomerId); + }); }); - cy.then(() => { - globalState.set("apiKey", savedApiKey); - globalState.set("customerId", savedCustomerId); + it("verify-connected-merchant-2-cannot-access-standard-customer", () => { + const savedApiKey = globalState.get("apiKey"); + const savedCustomerId = globalState.get("customerId"); + globalState.set("apiKey", globalState.get("apiKey_CM2")); + globalState.set("customerId", globalState.get("customerId_SM_Created")); + + cy.request({ + method: "GET", + url: `${globalState.get("baseUrl")}/customers/${globalState.get("customerId")}`, + headers: { + "Content-Type": "application/json", + "api-key": globalState.get("apiKey"), + }, + failOnStatusCode: false, + }).then((response) => { + expect(response.status).to.equal(404); + }); + + cy.then(() => { + globalState.set("apiKey", savedApiKey); + globalState.set("customerId", savedCustomerId); + }); }); - }); - it("verify-standard-merchant-can-access-its-own-customer", () => { - const savedApiKey = globalState.get("apiKey"); - const savedCustomerId = globalState.get("customerId"); - globalState.set("apiKey", globalState.get("apiKey_SM")); - globalState.set("customerId", globalState.get("customerId_SM_Created")); + it("verify-standard-merchant-can-access-its-own-customer", () => { + const savedApiKey = globalState.get("apiKey"); + const savedCustomerId = globalState.get("customerId"); + globalState.set("apiKey", globalState.get("apiKey_SM")); + globalState.set("customerId", globalState.get("customerId_SM_Created")); - cy.customerRetrieveCall(globalState); + cy.customerRetrieveCall(globalState); - cy.then(() => { - globalState.set("apiKey", savedApiKey); - globalState.set("customerId", savedCustomerId); + cy.then(() => { + globalState.set("apiKey", savedApiKey); + globalState.set("customerId", savedCustomerId); + }); }); - }); - }); + } + ); });