How to interact with components rendered by ReactTestRenderer / Jest
<p>I'm working with Jest and snapshot testing. What I'd like to do is render a component with <code>ReactTestRenderer</code>, then simulate clicking a button inside it, then verify the snapshot.</p>

<p>The object returned by ReactTestRenderer's <code>create</code> call has a <code>getInstance</code> function that allows me to call its methods directly, but it does not seem to work with any of the find/scry methods in ReactTestUtils.</p>

<p>I can manually traverse the tree and click the button, but it seems like there must be a better way:</p>

<pre><code>import React from 'react';
import ReactDOM from 'react-dom';
import MyCounter from './MyCounter';
import renderer from 'react-test-renderer';
import {Simulate, findRenderedDOMComponentWithClass} from 'react-addons-test-utils';

it('should render 0', () =&gt; {
  const component = renderer.create(&lt;MyCounter/&gt;);
  const inst = component.getInstance();

  // Calling methods directly works, but that's not the same as
  // simulating a click on the button...
  inst.increment();

  // This also works, but it's awfully verbose...
  component.toJSON().children[1].props.onClick();

  // I'm looking for something like...
  //   inst.find('.increment').click()
  // or:
  //   Simulate.click(inst.find('.increment'))
  // or:
  //   Simulate.click(findRenderedDOMComponentWithClass(inst, 'increment'))

  // Finally, verify the snapshot
  expect(component.toJSON()).toMatchSnapshot();
});
</code></pre>

<p>Does something like this exist?</p>