Last active
May 25, 2018 07:21
-
-
Save dferber90/498f2af46c724a93faaee560d1ff478d to your computer and use it in GitHub Desktop.
Test a Render Prop!
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 characters
describe('when <SuperApp /> renders', () => { | |
const wrapper = shallow(<SuperApp />) | |
.find(Mouse) | |
.renderProp('render', { x: 0, y: 0}) | |
.find(MouseDown) | |
.renderProp('render', { down: true }); | |
it('should render a heading containing the coordinates', () => { | |
expect( | |
wrapper.equals( | |
<h1>The mouse position is (0, 0) and the button is down</h1> | |
) | |
).toBe(true); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment