Issue by jrdrg
_Wednesday Jan 25, 2017 at 23:09 GMT_
_Originally opened as https://github.com/storybooks/storyshots/pull/76_
This PR adds the ability to pass options to the react-test-renderer create method, for example to allow mocking refs as per https://facebook.github.io/react/blog/2016/11/16/react-v15.4.0.html#mocking-refs-for-snapshot-testing
_jrdrg included the following code: https://github.com/storybooks/storyshots/pull/76/commits_
Comment by jrdrg
_Tuesday Jan 31, 2017 at 15:58 GMT_
@arunoda @roonyh without this PR, running a snapshot test on a component that uses a ref will result in the following error:

Comment by STRML
_Tuesday Feb 14, 2017 at 03:40 GMT_
This fixes #58 - would be very useful for us to deal with components that use refs.
Comment by jrdrg
_Thursday Feb 16, 2017 at 18:57 GMT_
@roonyh can you take a look when you get a chance?
Comment by testerez
_Saturday Mar 04, 2017 at 00:26 GMT_
With @jasonmorganson solution we could have a per-story mock: https://github.com/storybooks/storyshots/issues/58#issuecomment-265554582
Maybe an even better solution would be to add it to story.options.storyshots.createNodeMock. It would be cleaner if we end up needing more configuration options...
That said, options passed to initStoryshots could still be usefull as a default.
Hi, what's the status on this? I need this functionality and would like to do what I can to get it merged.
Hi, I've made a proposal for a react component-based api for defining stories and passing arbitrary props: https://github.com/storybooks/storybook/issues/993
It's now possible to set a (admittedly global) createNodeMock via the storyshots test option.
We still need a solution to doing it per-story, I suppose. See @theinterned's linked discussion issues.
@tmeasday can we close this now, or do we want to continue the per-story discussion here?
I think it's useful to have an open issue about this because it is something people need.
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 days. Thanks!
Hey there, it's me again! I am going to help our maintainers close this issue so they can focus on development efforts instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!
Most helpful comment
Hi, what's the status on this? I need this functionality and would like to do what I can to get it merged.