Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 740 Bytes

children.md

File metadata and controls

29 lines (16 loc) · 740 Bytes

.children([selector]) => ShallowWrapper

Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector can be provided and it will filter the children by this selector

Arguments

  1. selector (EnzymeSelector [optional]): A selector to filter the children by.

Returns

ShallowWrapper: A new wrapper that wraps the resulting nodes.

Examples

const wrapper = shallow(<ToDoList items={items} />);
expect(wrapper.find('ul').children()).to.have.lengthOf(items.length);

Related Methods