title: How to test if element exists?
body: <p>I want to check if inside my component exists a button.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, {useState} from 'react';
  
  const Text = ({text}) =&gt; {
      const [state, setState]= useState(0);
  
      const add  = () =&gt; {
          setState(state+1)
      };
  
      return (
          &lt;div&gt;
              &lt;h1&gt;Hello World&lt;/h1&gt;
              &lt;h2&gt;Hello {text}&lt;/h2&gt;
              &lt;h2&gt;Count {state}&lt;/h2&gt;
              &lt;button role="button" onClick={add}&gt;Increase&lt;/button&gt;
          &lt;/div&gt;
      );
  };
  
  export default Text;</code></pre>
  </div>
  </div>
  </p>
  <p>For that test i created:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>test('check counter', ()=&gt; {
      const { getByText } = render(&lt;Text /&gt;);
      const button = getByText("Increase");
      expect(button.toBeTruthy())
  });</code></pre>
  </div>
  </div>
  </p>
  <p>After running the test i get <code>TypeError: button.toBeTruthy is not a function</code>.
  Why this errror appears and how to solve the issue?</p>