-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
bug fix: getSeletors() #427
Conversation
selectors shouldn't be split by space, because selector itself can contain a space Example: .find('div[data-foo="foo bar"]')
<h1 data-foo="foo bar">Hello</h1> | ||
</div> | ||
); | ||
expect(wrapper.find('[data-foo="foo bar"]')).to.have.length(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add another test to verify that attribute queries still work without the attribute value?
wrapper.find("[data-foo]")
@rifeljm can we make sure this works with/covers the following cases as well:
^ The spaces don't show in the example, but they're there 😄 |
- selectors shouldn't be cleaned of multiple spaces - added few more tests
@rifeljm can you update the branch with master? After that I think we can merge 👍 |
LGTM |
Thanks @rifeljm |
Support for spaces in attribute selector values was added in 2.4.0 ([PR enzymejs#427](enzymejs#427)) but was not documented in the changelog. It took me a while to sort out why my selectors `option[value="by Alice"]` were working in 2.4.1 but not 2.3.0 ([see my gradual realization here](code-dot-org/code-dot-org#9830)). I'm recommending this get added to the changelog to save others some time.
selectors shouldn't be split by space, because selector itself can contain a space
Example: .find('div[data-foo="foo bar"]')