From 32f0d00808a2dad87ac048e89547916f314beab5 Mon Sep 17 00:00:00 2001 From: Splines Date: Tue, 15 Oct 2024 16:30:00 +0200 Subject: [PATCH] Cypress test that whitespaces in voucher hash work --- .vscode/settings.json | 3 ++- spec/cypress/e2e/vouchers_redemptions_spec.cy.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4f9a11422..d440bee39 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -114,7 +114,8 @@ "helpdesk", "katex", "Timecop", - "turbolinks" + "turbolinks", + "whitespaces" ], "cSpell.enableFiletypes": [ "ruby" diff --git a/spec/cypress/e2e/vouchers_redemptions_spec.cy.js b/spec/cypress/e2e/vouchers_redemptions_spec.cy.js index 305d0ff80..71db6b0cc 100644 --- a/spec/cypress/e2e/vouchers_redemptions_spec.cy.js +++ b/spec/cypress/e2e/vouchers_redemptions_spec.cy.js @@ -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", () => {