Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,568 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme. | ||
Before submitting, please read over our commonly reported issues to prevent duplicates! | ||
|
||
### All common issues | ||
|
||
* [common issues](/docs/common-issues) | ||
|
||
### Notoriously common issues | ||
|
||
* [Webpack build issues](/docs/common-issues#webpackbuildissues) | ||
* [Cannot find module 'react-dom/lib/ReactTestUtils'](/docs/common-issues) | ||
* [Query Selector fails](/docs/common-issues#queryselectorfails) | ||
* [Testing third party libraries](/docs/common-issues#testingthirdpartylibraries) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
}, | ||
"plugins": [ | ||
"edit-link", | ||
"prism", | ||
"prism@2.0.0", | ||
"-highlight", | ||
"github", | ||
"-search", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# `.exists() => Boolean` | ||
|
||
Returns whether or not the current node exists. | ||
|
||
|
||
#### Returns | ||
|
||
`Boolean`: whether or not the current node exists. | ||
|
||
|
||
|
||
#### Example | ||
|
||
|
||
```jsx | ||
const wrapper = mount(<div className="some-class" />); | ||
expect(wrapper.find('.other-class').exists()).to.be(false); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# `.getDOMNode() => DOMComponent` | ||
|
||
Returns the outer most DOMComponent of the current wrapper. | ||
|
||
Notes: | ||
- can only be called on a wrapper of a single node. | ||
- will raise if called on a wrapper of a stateless functional component. | ||
|
||
|
||
#### Returns | ||
|
||
`DOMComponent`: The retrieved DOM component. | ||
|
||
|
||
|
||
#### Examples | ||
|
||
```jsx | ||
const wrapper = mount(<MyComponent />); | ||
expect(wrapper.getDOMNode()).to.have.property("className"); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# `.getNode() => ReactElement` | ||
|
||
Returns the wrapper's underlying node. | ||
|
||
|
||
#### Returns | ||
|
||
`ReactElement`: The retrieved node. | ||
|
||
|
||
|
||
#### Examples | ||
|
||
```jsx | ||
class Test extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<span /> | ||
<span /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
const wrapper = mount(<Test />); | ||
expect(wrapper.getNode()).to.be.an.instanceof(Test); | ||
``` | ||
|
||
|
||
|
||
#### Related Methods | ||
|
||
- [`.getNodes() => Array<ReactElement>`](getNodes.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# `.getNodes() => Array<ReactElement>` | ||
|
||
Returns the wrapper's underlying nodes. | ||
|
||
|
||
#### Returns | ||
|
||
`Array<ReactElement>`: The retrieved nodes. | ||
|
||
|
||
|
||
#### Examples | ||
|
||
```jsx | ||
class Test extends React.Component { | ||
render() { | ||
return ( | ||
<div> | ||
<span /> | ||
<span /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
const wrapper = mount(<Test />); | ||
expect(wrapper.find('span').getNodes()).to.have.lengthOf(2); | ||
``` | ||
|
||
|
||
|
||
#### Related Methods | ||
|
||
- [`.getNode() => ReactElement`](getNode.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# `.exists() => Boolean` | ||
|
||
Returns whether or not the current node exists. | ||
|
||
|
||
#### Returns | ||
|
||
`Boolean`: whether or not the current node exists. | ||
|
||
|
||
|
||
#### Example | ||
|
||
|
||
```jsx | ||
const wrapper = shallow(<div className="some-class" />); | ||
expect(wrapper.find('.other-class').exists()).to.be(false); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.