title: How to test a className with the Jest and React testing library
body: <p>I am totally new to JavaScript testing and am working in a new codebase. I would like to write a test that is checking for a className on the element. I am working with Jest and <em><a href="https://testing-library.com/docs/react-testing-library/intro/" rel="noreferrer">React Testing Library</a></em>. Below I have a test that will render a button based on the <code>variant</code> prop. It also contains a className and I would like to test that.</p>
  <pre><code>it('Renders with a className equal to the variant', () =&gt; {
      const { container } = render(&lt;Button variant=&quot;default&quot; /&gt;)
      expect(container.firstChild) // Check for className here
  })
  </code></pre>
  <p>I tried to google for a property like Enzyme has with <code>hasClass</code>, but I couldn't find anything. How can I solve this with the current libraries (<em>React Testing Library</em> and Jest)?</p>