Skip to content

Commit

Permalink
Fix ShallowWrapper/simulate docs example. Was simulating on wrong node
Browse files Browse the repository at this point in the history
- Adds `.find('a')` so the click is simulated on `<a />` rather than `<Foo />`

Referenced here: #88 (comment) by @ljharb
  • Loading branch information
erikthedeveloper committed Dec 29, 2015
1 parent dd16110 commit 465bca0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/ShallowWrapper/simulate.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Foo extends React.Component {
const wrapper = shallow(<Foo />);

expect(wrapper.find('.clicks-0').length).to.equal(1);
wrapper.simulate('click');
wrapper.find('a').simulate('click');
expect(wrapper.find('.clicks-1').length).to.equal(1);
```

Expand Down

0 comments on commit 465bca0

Please sign in to comment.