Skip to content

Commit

Permalink
Cypress test that whitespaces in voucher hash work
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Oct 15, 2024
1 parent 509a1ec commit 32f0d00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
"helpdesk",
"katex",
"Timecop",
"turbolinks"
"turbolinks",
"whitespaces"
],
"cSpell.enableFiletypes": [
"ruby"
Expand Down
6 changes: 6 additions & 0 deletions spec/cypress/e2e/vouchers_redemptions_spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ describe("Verify Voucher Form", () => {
expect(message).to.equal(this.voucherInvalid);
});
});

it.only("is valid even if voucher string contains whitespaces at the beginning/end", function () {
cy.getBySelector("secure-hash-input").type(`\t ${this.voucher.secure_hash} `);
cy.getBySelector("verify-voucher-submit").click();
helpers.verifyVoucherRedemptionText();
});
});

describe("Tutor voucher redemption", () => {
Expand Down

0 comments on commit 32f0d00

Please sign in to comment.