Skip to content

Commit

Permalink
fix(queries): escape string in "When I find headings by text"
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Oct 6, 2023
1 parent 2fe8a4d commit 3e25598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/queries/heading.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getCypressElement, setCypressElement } from '../utils';
*/
export function When_I_find_headings_by_text(text: string) {
const selector = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
.map((tag) => `${tag}:contains('${text}'):visible`)
.map((tag) => `${tag}:contains(${JSON.stringify(text)}):visible`)
.join(',');
setCypressElement(cy.get(selector));
}
Expand Down

0 comments on commit 3e25598

Please sign in to comment.