Last active
April 27, 2018 07:24
-
-
Save mknabe/19be7277a8612e4a9ef9e3334cca54c9 to your computer and use it in GitHub Desktop.
Revisions
-
mknabe revised this gist
Aug 9, 2017 . 2 changed files with 20 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +0,0 @@ This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ /* Call a component method https://github.com/airbnb/enzyme/issues/208#issuecomment-187313486 */ const wrapper = shallow(<Button />); wrapper.instance().handleClick(); /* Re-render component after calling setState https://github.com/airbnb/enzyme/issues/450#issuecomment-225075145 */ expect(wrapper.update().find('#counter').text()).to.equal('1'); /* Pass props to event handler https://github.com/airbnb/enzyme/issues/400 */ wrapper.find('Select').simulate('change', { target: { value: 'text' }}); -
mknabe created this gist
Aug 9, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ /* Call a component method https://github.com/airbnb/enzyme/issues/208#issuecomment-187313486 */ const wrapper = shallow(<Button />); wrapper.instance().handleClick()