title: How to get the child div of parent div with some test id using react testing library?
body: <p>i want to get the div element within parent element with some test-id</p>
  
  <p>what i am trying to do?</p>
  
  <p>I have a parent div with test-id "parent-2" and it has a div element within it that has text Remove.</p>
  
  <p>i want to retreive this Remove div element. also there is multiple Remove div elements. something like below</p>
  
  <pre><code>&lt;div data-test-id="parent-1"&gt;
      &lt;div&gt;Remove&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-test-id="parent-2"&gt;
      &lt;div&gt;Remove&lt;/div&gt;
  &lt;/div&gt;
  &lt;div data-test-id="parent-3"&gt;
      &lt;div&gt;Remove&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So in the above html code i want to click Remove div from div with parent test-id = "parent-2"</p>
  
  <p>I have tried to do like below</p>
  
  <pre><code>utils.fireEvent.click(getByText('Remove'));
  </code></pre>
  
  <p>this throws error found multiple instances of Remove.</p>
  
  <p>I tried also this
      utils.fireEvent.click(getByTestId('parent-2').children[0];</p>
  
  <p>this works. but this accesses the first child of the parent. however wanted to be more specific with the query.</p>
  
  <p>So how can i fix this such that i can click Remove div belong to div of test-id "parent-2"</p>
  
  <p>thanks.</p>