Spec-Zone.ru › Enzyme

.children([selector]) => ReactWrapper

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

ReactWrapper: A new wrapper that wraps the resulting nodes.

Examples

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

Related Methods

  • .parents([selector]) => ReactWrapper
  • .parent() => ReactWrapper
  • .closest(selector) => ReactWrapper

© 2015 Airbnb, Inc.
Licensed under the MIT License.
https://enzymejs.github.io/enzyme/docs/api/ReactWrapper/children.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API