Skip to content

Commit 2d1b097

Browse files
committed
Match descendants only
Selectors like '.foo div' should not match on '<div className="foo" />'
1 parent 06ca24b commit 2d1b097

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/enzyme/src/selectors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ function matchDirectChild(nodes, predicate) {
317317
function matchDescendant(nodes, predicate) {
318318
return uniqueReduce(
319319
(matches, node) => matches.concat(treeFilter(node, predicate)),
320-
nodes,
320+
flatten(nodes.map(childrenOfNode)),
321321
);
322322
}
323323

0 commit comments

Comments
 (0)