title: Storyshots with react-testing-library
body: <p>I'm trying to add snapshots using <code>storybook</code> <code>v5.0.5</code> and <code>react-testing-library</code> <code>v6.0.3</code>  to do structural testing of all my stories.</p>
  
  <p>I'm trying to follow the docs:</p>
  
  <p><a href="https://github.com/infinitered/addon-storyshots/blob/master/README.md#serializer" rel="nofollow noreferrer">https://github.com/infinitered/addon-storyshots/blob/master/README.md#serializer</a></p>
  
  <p>But instead of enzyme, using <code>react-testing-library</code>.</p>
  
  <p>With Enzyme:</p>
  
  <pre class="lang-js prettyprint-override"><code>import initStoryshots from '@storybook/addon-storyshots';
  import toJSON from 'enzyme-to-json';
  
  initStoryshots({
    renderer: mount,
    serializer: toJSON,
    framework: 'react',
    storyRegex: /.*\.stories\.js/,
  });
  </code></pre>
  
  <p>With <code>react-testing-library</code> (What I'm trying to do):</p>
  
  <pre class="lang-js prettyprint-override"><code>import initStoryshots from '@storybook/addon-storyshots'
  import { render } from 'react-testing-library'
  
  initStoryshots({
    renderer: render,
    framework: 'react',
    storyRegex: /.*\.stories\.js/,
  })
  </code></pre>
  
  <p>I'm not sure, that the <code>render</code> method is the <strong>renderer</strong> that the Storyshot api requires. And also needs a <strong>serializer</strong> but I don't found an equivalent in <code>react-testing-library</code>.</p>
  
  <p>With these configuration, is creating the snapshots. However, these snapshots are not correct at all...</p>
  
  <p>Looks that the nodes doesn't have properties, and instead, is displaying a lot of useless properties...</p>
  
  <p>Example of created snapshot:</p>
  
  <pre><code>exports[`Storyshots Components.Accordion with a custom button 1`] = `
  Object {
    "asFragment": [Function],
    "baseElement": &lt;body&gt;
      &lt;div /&gt;
      &lt;div&gt;
      &lt;/div&gt;
    &lt;/body&gt;,
    "container": &lt;div&gt;
    &lt;/div&gt;,
    "debug": [Function],
    "findAllByAltText": [Function],
    "findAllByDisplayValue": [Function],
    "findAllByLabelText": [Function],
    "findAllByPlaceholderText": [Function],
    "findAllByRole": [Function],
    "findAllByTestId": [Function],
    "findAllByText": [Function],
    "findAllByTitle": [Function],
    "findByAltText": [Function],
    "findByDisplayValue": [Function],
    "findByLabelText": [Function],
    "findByPlaceholderText": [Function],
    "findByRole": [Function],
    "findByTestId": [Function],
    "findByText": [Function],
    "findByTitle": [Function],
    "getAllByAltText": [Function],
    "getAllByDisplayValue": [Function],
    "getAllByLabelText": [Function],
    "getAllByPlaceholderText": [Function],
    "getAllByRole": [Function],
    "getAllBySelectText": [Function],
    "getAllByTestId": [Function],
    "getAllByText": [Function],
    "getAllByTitle": [Function],
    "getAllByValue": [Function],
    "getByAltText": [Function],
    "getByDisplayValue": [Function],
    "getByLabelText": [Function],
    "getByPlaceholderText": [Function],
    "getByRole": [Function],
    "getBySelectText": [Function],
    "getByTestId": [Function],
    "getByText": [Function],
    "getByTitle": [Function],
    "getByValue": [Function],
    "queryAllByAltText": [Function],
    "queryAllByDisplayValue": [Function],
    "queryAllByLabelText": [Function],
    "queryAllByPlaceholderText": [Function],
    "queryAllByRole": [Function],
    "queryAllBySelectText": [Function],
    "queryAllByTestId": [Function],
    "queryAllByText": [Function],
    "queryAllByTitle": [Function],
    "queryAllByValue": [Function],
    "queryByAltText": [Function],
    "queryByDisplayValue": [Function],
    "queryByLabelText": [Function],
    "queryByPlaceholderText": [Function],
    "queryByRole": [Function],
    "queryBySelectText": [Function],
    "queryByTestId": [Function],
    "queryByText": [Function],
    "queryByTitle": [Function],
    "queryByValue": [Function],
    "rerender": [Function],
    "unmount": [Function],
  }
  `;
  </code></pre>
  
  <p>Can anybody help me with this? If I don't provide the <code>renderer</code> on the config, the snapshot is empty... However, looks that something is missing in this renderer...</p>
  
  <p>Thank you so much!</p>