Skip to content

Commit

Permalink
refactor: error check
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate committed Dec 18, 2024
1 parent 49f6418 commit 098d999
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cypress-tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,8 @@ Cypress.Commands.add(
.to.not.be.null;

if (typeof resData.body?.error_message === "undefined") {
expect(response.body.error_code, "error_code").to.be.null;
expect(response.body.error_message, "error_message").to.be.null;
expect(response.body.error_message, "error_message").to.exist;
expect(response.body.error_code, "error_code").to.exist;
}

if (response.body.capture_method === "automatic") {
Expand Down Expand Up @@ -1856,8 +1856,8 @@ Cypress.Commands.add(
expect(response.body.payment_token, "payment_token").to.not.be.null;

if (typeof resData.body?.error_message === "undefined") {
expect(response.body.error_code, "error_code").to.be.null;
expect(response.body.error_message, "error_message").to.be.null;
expect(response.body.error_message, "error_message").to.exist;
expect(response.body.error_code, "error_code").to.exist;
}

if (response.body.capture_method === "automatic") {
Expand Down

0 comments on commit 098d999

Please sign in to comment.