title: Testing Library: How to get parent node that has a child with Text
body: <p>In Testing Library, I'm trying to find a way to find elements whose children match a criteria:
  Lets concider this in the container rendered in the test:</p>
  <pre class="lang-html prettyprint-override"><code>    &lt;div class=&quot;classA&quot;&gt;
          &lt;div class=&quot;classB&quot;&gt;
              &lt;div class=&quot;classC&quot;&gt;
                  some text
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;classB&quot;&gt;
              &lt;div class=&quot;classC&quot;&gt;
                  more text
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>And I would like to find</p>
  <pre class="lang-html prettyprint-override"><code>    &lt;div class=&quot;classB&quot;&gt;
          &lt;div class=&quot;classC&quot;&gt;
              some text
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>I tried:
  <code>getByText(container, 'some text', {selector: 'classB'})</code> but it returns</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;classC&quot;&gt;
      some text
  &lt;/div&gt;
  </code></pre>
  <p>What am i missing to find the container/component/parent that would contain this text?</p>