`).
@@ -79,7 +94,9 @@ Returns `true` if `instance` is a DOM component (such as a `` or ``).
### isCompositeComponent
```javascript
-boolean isCompositeComponent(ReactComponent instance)`
+boolean isCompositeComponent(
+ ReactComponent instance
+)
```
Returns `true` if `instance` is a composite component (created with `React.createClass()`).
@@ -87,7 +104,10 @@ Returns `true` if `instance` is a composite component (created with `React.creat
### isCompositeComponentWithType
```javascript
-boolean isCompositeComponentWithType(ReactComponent instance, function componentClass)
+boolean isCompositeComponentWithType(
+ ReactComponent instance,
+ function componentClass
+)
```
Returns `true` if `instance` is a composite component (created with `React.createClass()`) whose type is of a React `componentClass`.
@@ -95,7 +115,10 @@ Returns `true` if `instance` is a composite component (created with `React.creat
### findAllInRenderedTree
```javascript
-array findAllInRenderedTree(ReactComponent tree, function test)
+array findAllInRenderedTree(
+ ReactComponent tree,
+ function test
+)
```
Traverse all components in `tree` and accumulate all components where `test(component)` is `true`. This is not that useful on its own, but it's used as a primitive for other test utils.
@@ -103,7 +126,9 @@ Traverse all components in `tree` and accumulate all components where `test(comp
### scryRenderedDOMComponentsWithClass
```javascript
-array scryRenderedDOMComponentsWithClass(ReactComponent tree, string className)
+array scryRenderedDOMComponentsWithClass(
+ ReactComponent tree, string className
+)
```
Finds all instances of components in the rendered tree that are DOM components with the class name matching `className`.
@@ -111,7 +136,10 @@ Finds all instances of components in the rendered tree that are DOM components w
### findRenderedDOMComponentWithClass
```javascript
-ReactComponent findRenderedDOMComponentWithClass(ReactComponent tree, string className)
+ReactComponent findRenderedDOMComponentWithClass(
+ ReactComponent tree,
+ string className
+)
```
Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
@@ -119,7 +147,10 @@ Like `scryRenderedDOMComponentsWithClass()` but expects there to be one result,
### scryRenderedDOMComponentsWithTag
```javascript
-array scryRenderedDOMComponentsWithTag(ReactComponent tree, string tagName)
+array scryRenderedDOMComponentsWithTag(
+ ReactComponent tree,
+ string tagName
+)
```
Finds all instances of components in the rendered tree that are DOM components with the tag name matching `tagName`.
@@ -127,7 +158,10 @@ Finds all instances of components in the rendered tree that are DOM components w
### findRenderedDOMComponentWithTag
```javascript
-ReactComponent findRenderedDOMComponentWithTag(ReactComponent tree, string tagName)
+ReactComponent findRenderedDOMComponentWithTag(
+ ReactComponent tree,
+ string tagName
+)
```
Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
@@ -135,7 +169,10 @@ Like `scryRenderedDOMComponentsWithTag()` but expects there to be one result, an
### scryRenderedComponentsWithType
```javascript
-array scryRenderedComponentsWithType(ReactComponent tree, function componentClass)
+array scryRenderedComponentsWithType(
+ ReactComponent tree,
+ function componentClass
+)
```
Finds all instances of components with type equal to `componentClass`.
@@ -143,7 +180,9 @@ Finds all instances of components with type equal to `componentClass`.
### findRenderedComponentWithType
```javascript
-ReactComponent findRenderedComponentWithType(ReactComponent tree, function componentClass)
+ReactComponent findRenderedComponentWithType(
+ ReactComponent tree, function componentClass
+)
```
Same as `scryRenderedComponentsWithType()` but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.
@@ -160,7 +199,9 @@ ReactShallowRenderer createRenderer()
Call this in your tests to create a shallow renderer. You can think of this as a "place" to render the component you're testing, where it can respond to events and update itself.
```javascript
-shallowRenderer.render(ReactElement element)
+shallowRenderer.render(
+ ReactElement element
+)
```
Similar to `React.render`.