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

BUG: Descendent Selector Broken in 3.4.4 #1777

Closed
bdwain opened this issue Aug 20, 2018 · 1 comment
Closed

BUG: Descendent Selector Broken in 3.4.4 #1777

bdwain opened this issue Aug 20, 2018 · 1 comment

Comments

@bdwain
Copy link
Contributor

bdwain commented Aug 20, 2018

Describe the bug
The descendent selector (.find('.foo .bar')) seems to have broken in the latest release. It seems to have been broken in #1680 .

I have a component that returns something like

//note: Button is a component
<div className="button-group">
  <Button classname=".foo" onClick={this.handleFoo}>foo</Button>
  <Button classname=".bar" onClick={this.handleBar}>bar</Button>
</div>

and then this fails because find returned 0 nodes

const wrapper = shallow(<ButtonGroup />);
wrapper.find('.button-group .bar').simulate('click');

To Reproduce
Working on a reproduction. Will add it when it's ready. See example above though.

Expected behavior
The call to .find should return a wrapper around the second button

Desktop (please complete the following information):

  • OS: OS X High Sierra
  • Browser Chrome
  • Version: 68

Additional context
The error began when upgrading from 3.4.1 to 3.4.4. I was able to remove it by reverting only the one-line change in #1680 in my node modules directory.

Versions:
Enzyme: 3.4.4
enzyme-adapter-react-16: 1.2.0
enzyme-adapter-utils: 1.5.0
react: 16.4.2

@bdwain bdwain changed the title Descendent Selector Broken in 3.4.4 BUG: Descendent Selector Broken in 3.4.4 Aug 20, 2018
@bdwain bdwain closed this as completed Aug 20, 2018
@bdwain
Copy link
Contributor Author

bdwain commented Aug 20, 2018

Sorry i was mistaken. I misread the original code

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

No branches or pull requests

1 participant