fix(cypress): add validations to cypress list apis (#6029)

This commit is contained in:
Pa1NarK
2024-09-26 19:32:35 +05:30
committed by GitHub
parent 991ca38b50
commit 567ac8f1e4

View File

@ -1214,7 +1214,7 @@ Cypress.Commands.add("merchantAccountsListCall", (globalState) => {
} else {
// to be updated
throw new Error(
`API Keys list call failed with status ${response.status} and message ${response.body.message}`
`Merchant accounts list call failed with status ${response.status} and message ${response.body.message}`
);
}
});
@ -1255,7 +1255,7 @@ Cypress.Commands.add("businessProfilesListCall", (globalState) => {
} else {
// to be updated
throw new Error(
`API Keys list call failed with status ${response.status} and message ${response.body.message}`
`Business profiles list call failed with status ${response.status} and message ${response.body.message}`
);
}
});
@ -1347,6 +1347,14 @@ Cypress.Commands.add("apiKeysListCall", (globalState) => {
if (response.status === 200) {
// This end point does not work
expect(response.body).to.be.an("array").and.to.not.be.empty;
for (const key in response.body) {
expect(response.body[key])
.to.have.property("key_id")
.and.to.include("dev_").and.to.not.be.empty;
expect(response.body[key])
.to.have.property("merchant_id")
.and.to.equal(merchant_id).and.to.not.be.empty;
}
} else {
// to be updated
throw new Error(