Skip to content

Instantly share code, notes, and snippets.

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