-
-
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
id selector does not seem to work #64
Comments
Just to add, I had the following configuration in my karma config. Not sure if it affects for shallow rendering. externals: {
'jsdom': 'window',
'cheerio': 'window',
'react/lib/ExecutionEnvironment': true,
} |
Hi @clouddra, can you confirm that the following code works? const wrapper = shallow(
<div>
<div id='ttt' className='ttt'>hello</div>
</div>
);
console.log(wrapper.find('#ttt').length); // 1 There may be some edge-case behavior when the id you are looking for is on the root node... especially if you're using React 0.14, where shallow rendering of a DOM Element as opposed to a composite component is behavior shimmed by enzyme rather than built in to the shallow renderer. |
Confirmed the issue and fixed. Will publish to npm later today when this lands. |
@clouddra The fix is now available in v1.2.0 |
@lelandrichardson That was fast! Tested it and it works fine. Thanks a lot for your help. |
Was trying to test a simple piece of code:
and it returns an empty array when i tried to use an id selector. It works fine on class selectors.
The text was updated successfully, but these errors were encountered: