title: React testing library fireEvent.click not working
body: <p>I am trying to basically just change a counter and show that the value has changed. I am doing this with <code>getByTestId</code> so that could be the problem ?</p>
  
  <p>Here is my component: </p>
  
  <pre><code>import React, { useState } from 'react';
  import logo from './logo.svg';
  import './App.css';
  
  function App() {
      const [count, setCounter] = useState(0)
    return (
      &lt;div className="App"&gt;
        &lt;header className="App-header"&gt;
          &lt;img src={logo} className="App-logo" alt="logo" /&gt;
                  div
                  &lt;div
                      onClick={() =&gt; setCounter(prevCount =&gt; prevCount + 1)}
                      data-testid="addCount"
                  &gt;
                      +
                  &lt;/div&gt;
          &lt;div data-testid="count"&gt;
            {count}
          &lt;/div&gt;
                  &lt;div
                      onClick={() =&gt; setCounter(prevCount =&gt; prevCount - 1)}
                      data-testid="minusCount"
                  &gt;
                      -
                  &lt;/div&gt;
          &lt;a
            className="App-link"
            href="https://reactjs.org"
            target="_blank"
            rel="noopener noreferrer"
          &gt;
            Learn React
          &lt;/a&gt;
        &lt;/header&gt;
      &lt;/div&gt;
    );
  }
  
  export default App;
  
  </code></pre>
  
  <p>Here is the test I am trying to run:</p>
  
  <pre><code>
  describe('State is managed correctly', () =&gt; {
      const { getByTestId } = render(&lt;App /&gt;)
      const add = getByTestId(`addCount`)
      const count = getByTestId(`count`)
  
      it('count starts at 0', () =&gt; {
          expect(count).toHaveTextContent("0")
      })
  
  
   it('count added, value should be 1', () =&gt; {
          fireEvent.click(add)
          expect(count).toHaveTextContent("1") // error count is still 0
      })
  })
  </code></pre>