.childAt(index) => ShallowWrapper
Returns a new wrapper with child at the specified index.
Arguments
-
index(number): A zero-based integer indicating which node to retrieve.
Returns
ShallowWrapper: A new wrapper that wraps the resulting node.
Examples
const wrapper = shallow(<ToDoList items={items} />);
expect(wrapper.find('ul').childAt(0).type()).to.equal('li');
Related Methods
.parents([selector]) => ShallowWrapper.parent() => ShallowWrapper.closest(selector) => ShallowWrapper.children([selector]) => ShallowWrapper
© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://enzymejs.github.io/enzyme/docs/api/ShallowWrapper/childAt.html