Returns whether or not all of the nodes in the wrapper pass the provided predicate function.
predicate
(ShallowWrapper => Boolean
): A predicate function to match the nodes.Boolean
: True if every node in the current wrapper passed the predicate function.
const wrapper = shallow(( <div> <div className="foo qoo" /> <div className="foo boo" /> <div className="foo hoo" /> </div> )); expect(wrapper.find('.foo').everyWhere(n => n.hasClass('foo'))).to.equal(true); expect(wrapper.find('.foo').everyWhere(n => n.hasClass('qoo'))).to.equal(false); expect(wrapper.find('.foo').everyWhere(n => n.hasClass('bar'))).to.equal(false);
© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://airbnb.io/enzyme/docs/api/ShallowWrapper/everyWhere.html