-
-
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
Changed tests to highlight a bug with contains, fixed the bug in Utils/containsChildrenSubArray #226
Conversation
<div>Goodbye</div>, | ||
<span>More</span>, |
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.
Could you include both tests (with both orderings, i mean) to ensure we don't regress in the future?
Sure I added both cases as passes1 and passes2 @ljharb |
Thanks! hmm - i can't find anything in the documentation that talks about whether order should or shouldn't matter if you pass an array of nodes. However, the usage of @CurtisHumphrey it'd be awesome if you could rebase this on top of latest master - if not, no worries. @lelandrichardson what do you think about updating the docs to explicitly mention the "any" semantics as well as that ordering doesn't matter? |
1306cbf
to
e81f950
Compare
@ljharb I just rebased |
@ljharb I think you may have misread this function. If the render tree contains the entire array being passed in, then it matches. This means that order does matter. The bug was that this was only working properly if the array in the tree started with this sub-array. Thanks for catching this, @CurtisHumphrey ! |
@CurtisHumphrey do you mind rebasing and squashing, and I'll merge this in? Thanks! |
@lelandrichardson ah, thanks for clarifying. I definitely misread the test, but looking at it again, what you say is indeed represented in the tests :-) |
…renSubArray moved checker to another line to make linter happy Updated based on feedback from PR
e81f950
to
c82293c
Compare
@lelandrichardson rebased and squashed |
[contains] Fix bug for matching sub arrays
moved checker to another line to make linter happy