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

Fix pathToNode with a sibling node which has children #296

Merged

Conversation

koba04
Copy link
Contributor

@koba04 koba04 commented Apr 6, 2016

Currently, the following test is failed.

const wrapper = shallow(
  <div className="bax">
    <div className="foo">
      <div className="bar">
        <div className="baz" />
        <div>
          <div />
        </div>
      </div>
    </div>
  </div>
);

expect(wrapper.find('.baz').parent().hasClass('bar')).to.equal(true);

This is because pathToNode returns trees which are including the sibling node.
This PR makes pathToNode return only nodes including the current node.

Thanks

@lelandrichardson
Copy link
Collaborator

Thanks for helping out. This is a great fix.

Do you mind rebasing before I merge it in? Thanks!

@koba04 koba04 force-pushed the fix-path-to-node-sibling-node branch from e1de5f5 to eb07578 Compare April 13, 2016 01:03
@koba04
Copy link
Contributor Author

koba04 commented Apr 13, 2016

@lelandrichardson Thank you! rebased.

@lelandrichardson lelandrichardson merged commit de4cb59 into enzymejs:master Apr 13, 2016
@koba04 koba04 deleted the fix-path-to-node-sibling-node branch April 13, 2016 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants