From 9d11d58ae84c347653132a50f44b720ecd44cfb6 Mon Sep 17 00:00:00 2001 From: Mauricio Soares Date: Tue, 16 Feb 2016 09:34:28 -0200 Subject: [PATCH] update docs --- docs/README.md | 2 ++ docs/api/ReactWrapper/childAt.md | 2 +- docs/api/ShallowWrapper/childAt.md | 2 +- docs/api/mount.md | 11 +++++++---- docs/api/shallow.md | 5 ++++- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/README.md b/docs/README.md index 9607f62f7..575deabdb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,6 +24,7 @@ * [is(selector)](/docs/api/ShallowWrapper/is.md) * [not(selector)](/docs/api/ShallowWrapper/not.md) * [children()](/docs/api/ShallowWrapper/children.md) + * [childAt()](/docs/api/ShallowWrapper/childAt.md) * [parents()](/docs/api/ShallowWrapper/parents.md) * [parent()](/docs/api/ShallowWrapper/parent.md) * [closest(selector)](/docs/api/ShallowWrapper/closest.md) @@ -65,6 +66,7 @@ * [is(selector)](/docs/api/ReactWrapper/is.md) * [not(selector)](/docs/api/ReactWrapper/not.md) * [children()](/docs/api/ReactWrapper/children.md) + * [childAt()](/docs/api/ReactWrapper/childAt.md) * [parents()](/docs/api/ReactWrapper/parents.md) * [parent()](/docs/api/ReactWrapper/parent.md) * [closest(selector)](/docs/api/ReactWrapper/closest.md) diff --git a/docs/api/ReactWrapper/childAt.md b/docs/api/ReactWrapper/childAt.md index ae1353b28..67d0276c6 100644 --- a/docs/api/ReactWrapper/childAt.md +++ b/docs/api/ReactWrapper/childAt.md @@ -17,7 +17,7 @@ Returns a new wrapper with child at the specified index. ```jsx const wrapper = mount(); -expect(wrapper.find('ul').childAt(0).type).to.equal('li'); +expect(wrapper.find('ul').childAt(0).type()).to.equal('li'); ``` #### Related Methods diff --git a/docs/api/ShallowWrapper/childAt.md b/docs/api/ShallowWrapper/childAt.md index e68d05698..192183103 100644 --- a/docs/api/ShallowWrapper/childAt.md +++ b/docs/api/ShallowWrapper/childAt.md @@ -17,7 +17,7 @@ Returns a new wrapper with child at the specified index. ```jsx const wrapper = shallow(); -expect(wrapper.find('ul').childAt(0).type).to.equal('li'); +expect(wrapper.find('ul').childAt(0).type()).to.equal('li'); ``` #### Related Methods diff --git a/docs/api/mount.md b/docs/api/mount.md index 7e05ad50a..668136399 100644 --- a/docs/api/mount.md +++ b/docs/api/mount.md @@ -4,10 +4,10 @@ Full DOM rendering is ideal for use cases where you have components that may int or may require the full lifecycle in order to fully test the component (ie, `componentDidMount` etc.) -Full DOM rendering requires that a full DOM API be available at the global scope. This means that -it must be run in an environment that at least "looks like" a browser environment. If you do not -want to run your tests inside of a browser, the recommended approach to using `mount` is to depend -on a library called [jsdom](https://github.com/tmpvar/jsdom) which is essentially a headless browser +Full DOM rendering requires that a full DOM API be available at the global scope. This means that +it must be run in an environment that at least "looks like" a browser environment. If you do not +want to run your tests inside of a browser, the recommended approach to using `mount` is to depend +on a library called [jsdom](https://github.com/tmpvar/jsdom) which is essentially a headless browser implemented completely in JS. ```jsx @@ -84,6 +84,9 @@ Remove nodes in the current wrapper that match the provided selector. (inverse o #### [`.children() => ReactWrapper`](ReactWrapper/children.md) Get a wrapper with all of the children nodes of the current wrapper. +#### [`.childAt() => ReactWrapper`](ReactWrapper/childAt.md) +Returns a new wrapper with child at the specified index. + #### [`.parents() => ReactWrapper`](ReactWrapper/parents.md) Get a wrapper with all of the parents (ancestors) of the current node. diff --git a/docs/api/shallow.md b/docs/api/shallow.md index 26755db79..8c13c96cc 100644 --- a/docs/api/shallow.md +++ b/docs/api/shallow.md @@ -45,7 +45,7 @@ describe('', () => { #### Arguments 1. `node` (`ReactElement`): The node to render -2. `options` (`Object` [optional]): +2. `options` (`Object` [optional]): - `options.context`: (`Object` [optional]): Context to be passed into the component #### Returns @@ -85,6 +85,9 @@ Remove nodes in the current wrapper that match the provided selector. (inverse o #### [`.children() => ShallowWrapper`](ShallowWrapper/children.md) Get a wrapper with all of the children nodes of the current wrapper. +#### [`.childAt() => ShallowWrapper`](ShallowWrapper/childAt.md) +Returns a new wrapper with child at the specified index. + #### [`.parents() => ShallowWrapper`](ShallowWrapper/parents.md) Get a wrapper with all of the parents (ancestors) of the current node.