Skip to content

Instantly share code, notes, and snippets.

@AdamBrodzinski
Created July 20, 2015 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBrodzinski/c046ba1abfe88b670fae to your computer and use it in GitHub Desktop.
Save AdamBrodzinski/c046ba1abfe88b670fae to your computer and use it in GitHub Desktop.
TestUtils = React.addons.TestUtils;
Simulate = TestUtils.Simulate;
// returns rendered react component
renderComponent = function (comp, props) {
return TestUtils.renderIntoDocument(
React.createElement(comp, props)
);
};
// more terse method of simulating events
simulateClickOn = function($el) {
React.addons.TestUtils.Simulate.click($el[0]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment