title: How do you test for the non-existence of anchor element using jest and react-testing-library?
body: <p>My react component renders a link based on a rule.</p>
  <p>The mark up is rendered as such when there is a link within the h4 element.</p>
  <pre><code>&lt;h4&gt;&lt;a href=&quot;&quot;&gt;foo&lt;/a&gt;&lt;/h4&gt;
  &lt;p&gt;blah blah &lt;a href=&quot;&quot;&gt;bar&lt;/a&gt; blah blah&lt;/p&gt;
  </code></pre>
  <p>This is my how test is written to verify a link exist.</p>
  <pre><code>  const props = {
      heading: 'foo',
      headingLink: '//www.bar.com',
    }
  
    test('render the heading text with link', () =&gt; {
      const { getByText } = render(&lt;Component {...props} /&gt;)
      getByText(props.heading)
      expect(getByText(props.heading).getAttribute('href')).toBe(props.headingLink)
    })
  </code></pre>
  <p>How would I test that the anchor element isn't rendered/doesn't exist in the h4?</p>
  <pre><code>&lt;h4&gt;foo&lt;/h4&gt;
  &lt;p&gt;blah blah &lt;a href=&quot;&quot;&gt;bar&lt;/a&gt; blah blah&lt;/p&gt;
  </code></pre>