diff --git a/spec/cypress/e2e/voucher_redemption_spec.cy.js b/spec/cypress/e2e/voucher_redemption_spec.cy.js index 8c04a1aa2..ef0857459 100644 --- a/spec/cypress/e2e/voucher_redemption_spec.cy.js +++ b/spec/cypress/e2e/voucher_redemption_spec.cy.js @@ -89,7 +89,8 @@ describe("Profile page", () => { cy.then(() => { submitVoucher(this.voucher); cy.getBySelector("claim-select").should("be.visible"); - cy.getBySelector("claim-select").tomselect([this.tutorial1.id, this.tutorial2.id]); + cy.getBySelector("claim-select") + .select([this.tutorial1.id, this.tutorial2.id], { force: true }); cy.getBySelector("claim-submit").click(); cy.then(() => { cy.getBySelector("flash-notice").should("be.visible"); diff --git a/spec/cypress/support/commands.js b/spec/cypress/support/commands.js index 9e4232f25..5d2a6db15 100644 --- a/spec/cypress/support/commands.js +++ b/spec/cypress/support/commands.js @@ -5,14 +5,6 @@ Cypress.Commands.add("getBySelector", (selector, ...args) => { return cy.get(`[data-cy=${selector}]`, ...args); }); -// Extend the .select() command to automatically set the force: true flag -Cypress.Commands.add("tomselect", { prevSubject: "element" }, (subject, values, options = {}) => { - // Merge the provided options with the force: true option - const mergedOptions = { ...options, force: true }; - - // Call the original .select() command with the merged options - return cy.wrap(subject).select(values, mergedOptions); -}); /** * Expects the subject to be an anchor element `` with a target attribute set * to "_blank", such that the link opens in a new tab.