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 committed Jun 17, 2018
1 parent 06ca24b commit 2d1b097
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 @@ -317,7 +317,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 2d1b097

Please sign in to comment.