Browse Source

Enclose variables in back quote

main
Kohei TAKATA 9 years ago
parent
commit
c1160668d9
  1. 14
      docs/10.4-test-utils.md

14
docs/10.4-test-utils.md

@ -49,7 +49,7 @@ Pass a mocked component module to this method to augment it with useful methods
boolean isElement(ReactElement element) boolean isElement(ReactElement element)
``` ```
Returns true if `element` is any ReactElement. Returns `true` if `element` is any ReactElement.
### isElementOfType ### isElementOfType
@ -57,7 +57,7 @@ Returns true if `element` is any ReactElement.
boolean isElementOfType(ReactElement element, function componentClass) boolean isElementOfType(ReactElement element, function componentClass)
``` ```
Returns true if `element` is a ReactElement whose type is of a React `componentClass`. Returns `true` if `element` is a ReactElement whose type is of a React `componentClass`.
### isDOMComponent ### isDOMComponent
@ -65,7 +65,7 @@ Returns true if `element` is a ReactElement whose type is of a React `componentC
boolean isDOMComponent(ReactComponent instance) boolean isDOMComponent(ReactComponent instance)
``` ```
Returns true if `instance` is a DOM component (such as a `<div>` or `<span>`). Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
### isCompositeComponent ### isCompositeComponent
@ -73,7 +73,7 @@ Returns true if `instance` is a DOM component (such as a `<div>` or `<span>`).
boolean isCompositeComponent(ReactComponent instance)` boolean isCompositeComponent(ReactComponent instance)`
``` ```
Returns true if `instance` is a composite component (created with `React.createClass()`). Returns `true` if `instance` is a composite component (created with `React.createClass()`).
### isCompositeComponentWithType ### isCompositeComponentWithType
@ -81,7 +81,7 @@ Returns true if `instance` is a composite component (created with `React.createC
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`. Returns `true` if `instance` is a composite component (created with `React.createClass()`) whose type is of a React `componentClass`.
### findAllInRenderedTree ### findAllInRenderedTree
@ -89,7 +89,7 @@ Returns true if `instance` is a composite component (created with `React.createC
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. 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.
### scryRenderedDOMComponentsWithClass ### scryRenderedDOMComponentsWithClass
@ -160,7 +160,7 @@ Similar to `React.render`.
ReactComponent shallowRenderer.getRenderOutput() ReactComponent shallowRenderer.getRenderOutput()
``` ```
After render has been called, returns shallowly rendered output. You can then begin to assert facts about the output. For example, if your component's render method returns: After `render` has been called, returns shallowly rendered output. You can then begin to assert facts about the output. For example, if your component's render method returns:
```javascript ```javascript
<div> <div>

Loading…
Cancel
Save