Skip to content

Commit

Permalink
Remove .tomselect Command for cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
fosterfarrell9 committed Aug 24, 2024
1 parent 7f68ee9 commit 74cae07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 2 additions & 1 deletion spec/cypress/e2e/voucher_redemption_spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
8 changes: 0 additions & 8 deletions spec/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<a>` with a target attribute set
* to "_blank", such that the link opens in a new tab.
Expand Down

0 comments on commit 74cae07

Please sign in to comment.