Skip to content

Commit

Permalink
Match descendants only
Browse files Browse the repository at this point in the history
Selectors like '.foo div' should not match on '<div className="foo" />'
  • Loading branch information
ReactiveRaven authored and ljharb committed Jun 17, 2018
1 parent f48a419 commit 938005f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/enzyme/src/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function matchDirectChild(nodes, predicate) {
function matchDescendant(nodes, predicate) {
return uniqueReduce(
(matches, node) => matches.concat(treeFilter(node, predicate)),
nodes,
flatten(nodes.map(childrenOfNode)),
);
}

Expand Down

0 comments on commit 938005f

Please sign in to comment.