Spec-Zone.ru › Enzyme

.childAt(index) => ReactWrapper

Returns a new wrapper with child at the specified index.

Arguments

  1. index (number): A zero-based integer indicating which node to retrieve.

Returns

ReactWrapper: A new wrapper that wraps the resulting node.

Examples

const wrapper = mount(<ToDoList items={items} />);
expect(wrapper.find('ul').childAt(0).type()).to.equal('li');

Related Methods

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

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

Spec-Zone.ru

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