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

Make children select work as it should #174

Open
feliupe opened this issue Feb 2, 2018 · 1 comment
Open

Make children select work as it should #174

feliupe opened this issue Feb 2, 2018 · 1 comment

Comments

@feliupe
Copy link

feliupe commented Feb 2, 2018

I have a question:

Sorry if I misunderstood the way it should work. I have the following html:

<div class='Item'>
  <span>Span #1, in the div.
    A
   <div class='Item'>   <span>B</span> </div>
  </span>
</div>

and my test as:

wrapper.find('.Item > span').length == 1 // and  'should' be true but it returns 2

This is not how the css selector should behave?

@eddyerburgh
Copy link
Owner

This is the correct behavior I believe.

There are two elements that match that selector, the first span tag, and the second span tag. Both are direct descendants of an element with .Item class

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

2 participants