Skip to content

Instantly share code, notes, and snippets.

@AdamBrodzinski
Created July 20, 2015 00:42
Show Gist options
  • Select an option

  • Save AdamBrodzinski/c046ba1abfe88b670fae to your computer and use it in GitHub Desktop.

Select an option

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