Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true.
predicate
(ReactWrapper => Boolean
): A predicate function that is passed a wrapped node.ReactWrapper
: A new wrapper that wraps the filtered nodes.
const wrapper = mount(<MyComponent />); const complexComponents = wrapper.find('.foo').filterWhere(n => typeof n.type() !== 'string'); expect(complexComponents).to.have.lengthOf(4);
© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://airbnb.io/enzyme/docs/api/ReactWrapper/filterWhere.html