title: Passing variable as argument to getByText from react testing library does not work
body: <p>If you pass string literal to getByText from react testing library it works fine</p>
  <pre><code>getByText('my text')
  </code></pre>
  <p>but if you pass same string as variable it finds nothing</p>
  <pre><code>const text: string = 'my text'
  getByText(text) // this returns no match even though with literal it worked fine
  </code></pre>
  <p>what could be the problem?</p>
  <pre><code>test('page displays users activities on load', async () =&gt; {
      const history = createMemoryHistory();
      const {getByText} = render(
          &lt;Router history={history}&gt;
              &lt;Dashboard /&gt;
          &lt;/Router&gt;
      )
  
      await waitFor(() =&gt; getByText(&quot;Programovanie v jazyku C&quot;, {exact: false}))
  
      activityData.forEach((activity) =&gt; {
          expect(getByText(activity.title, {exact: false})).toBeTruthy()
      })
  })
  </code></pre>
  <p>Edit: Added my code</p>
  <p>Component dashboard contains tables, which are populated from mock api. Mock api data is same data as <code>activityData</code>. Wait for is called with string literal, title of first item of activityData. That works fine. But it doesnt work, whan called with variable.</p>