Skip to content

Commit

Permalink
refactor: add a check for existence of error code and message
Browse files Browse the repository at this point in the history
this is allow us to see the error message directly in the screenshot
without us manually running the test
  • Loading branch information
pixincreate committed Dec 18, 2024
1 parent 6c170a6 commit f19226d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cypress-tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,11 @@ Cypress.Commands.add(
expect(response.body.profile_id, "profile_id").to.equal(profileId).and
.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;
}

if (response.body.capture_method === "automatic") {
if (response.body.authentication_type === "three_ds") {
expect(response.body)
Expand Down Expand Up @@ -1850,6 +1855,11 @@ Cypress.Commands.add(
expect(response.body.profile_id, "profile_id").to.not.be.null;
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;
}

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

0 comments on commit f19226d

Please sign in to comment.