Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass down props to ReactStubElements #14

Closed
rexk opened this issue Jul 9, 2015 · 0 comments · Fixed by #15
Closed

Pass down props to ReactStubElements #14

rexk opened this issue Jul 9, 2015 · 0 comments · Fixed by #15

Comments

@rexk
Copy link
Owner

rexk commented Jul 9, 2015

https://github.com/rexk/mocha-mix/blob/master/lib/mocha-mix.js#L56

following change will allow all simulated events to be captured through mock classes

function createStubReactClass(tagName, name) {
  return React.createClass({
    displayName: (name || '') + ' stub',
    render: function () {
      return React.createElement(tagName);
    }
  });
}
function createStubReactClass(tagName, name) {
  return React.createClass({
    displayName: (name || '') + ' stub',
    render: function () {
      return React.createElement(
         tagName, 
         this.props, 
         this.props.children
      );
    }
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant