Skip to content

Commit

Permalink
test: escape cy.get() selector in getByTestID
Browse files Browse the repository at this point in the history
Using jquery escapeSelector() because cypress is running jquery under the hood
  • Loading branch information
kyleleow committed Aug 3, 2021
1 parent 6c82263 commit 53284d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ declare global {
}

Cypress.Commands.add('getByTestID', (selector, ...args) => {
return cy.get(`[data-testid=${selector}]`, ...args)
return cy.get(`[data-testid=${Cypress.$.escapeSelector(selector)}]`, ...args)
})

Cypress.Commands.add('createEmptyWallet', (isRandom: boolean = false) => {
Expand Down

0 comments on commit 53284d9

Please sign in to comment.