Last active
May 25, 2018 07:08
-
-
Save dferber90/b84d7d1f51b6b7101f74fd15f6d2365f 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 <App /> renders', () => { | |
const wrapper = shallow(<App />); | |
const mouseWrapper = shallow( | |
wrapper.find(Mouse).prop('render')({ x: 0, y: 0 }) | |
); | |
it('should render a string containing the coordinates', () => { | |
expect(mouseWrapper.equals(<h1>The mouse position is (0, 0)</h1>)).toBe( | |
true | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment