Returns a wrapper around all of the parents/ancestors of the single node in the wrapper. Does not include the node itself. Optionally, a selector can be provided and it will filter the parents by this selector. It must be a single-node wrapper.
selector
(EnzymeSelector
[optional]): The selector to filter the parents by.ReactWrapper
: A new wrapper that wraps the resulting nodes.
const wrapper = mount(<ToDoList />); expect(wrapper.find('ul').parents()).to.have.lengthOf(2);
© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://airbnb.io/enzyme/docs/api/ReactWrapper/parents.html