Skip to content

Instantly share code, notes, and snippets.

@dferber90
Last active May 25, 2018 07:21
Show Gist options
  • Save dferber90/498f2af46c724a93faaee560d1ff478d to your computer and use it in GitHub Desktop.
Save dferber90/498f2af46c724a93faaee560d1ff478d to your computer and use it in GitHub Desktop.
Test a Render Prop!
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