Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#911@minor: Adds support for "i" and "s" modifiers to attribute query… #913

Conversation

capricorn86
Copy link
Owner

… selectors.

@capricorn86 capricorn86 merged commit 0744805 into master May 12, 2023
1 check passed
@capricorn86 capricorn86 deleted the task/911-domexception-is-thrown-for-substring-matching-attribute-selectors-with-whitespaces branch May 12, 2023 09:36
switch (attribute.operator) {
// [attribute~="value"] - Contains a specified word.
case '~':
return new RegExp(`[- ]${attribute.value}|${attribute.value}[- ]`, modifier);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems to affect testing-library getByRole("menu") which translates to *[role~="menu"] selector.

Regular expression now expects either dash or space to be always present. Probably the same issue for | operator below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOMException is thrown for substring matching attribute selectors with whitespaces
2 participants