title: Test input Search box with React testing library
body: <p>I have a SearchBox component:</p>
  <pre class="lang-js prettyprint-override"><code>    function SearchBox({ search, setSearch }) {
        return (
          &lt;div&gt;
            &lt;div&gt;
              &lt;input onChange={e =&gt; setSearch(e.target.value)} type=&quot;text&quot; placeholder=&quot;Search...&quot; value={search} /&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        )
      }
  </code></pre>
  <p>I tried the following:</p>
  <pre class="lang-js prettyprint-override"><code>    describe('Input value', () =&gt; {
        it('updates on change', () =&gt; {
          const { queryByPlaceholderText } = render(&lt;SearchBox /&gt;)
      
          const searchInput = queryByPlaceholderText('Search...')
      
          fireEvent.change(searchInput, { target: { value: 'test' } })
      
          expect(searchInput.value).toBe('test')
        })
      })
  </code></pre>
  <p>But then I get an error:</p>
  <blockquote>
  <p>Error: Uncaught [TypeError: setSearch is not a function]</p>
  </blockquote>
  <p>How and what can I test on this SearchBox component?</p>