title: how to check negative and positive scenarios in jest?
body: <p>I'm writing a unit test in Jest for one of the React component But in both scenarios, I'm getting a false response.</p>
  <p><code>foo.js</code>:</p>
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  
  function Foo({ data }) {
    if (data === true) {
      return (
        &lt;div className=&quot;hello&quot; id=&quot;helloId&quot;&gt;
          Hello
        &lt;/div&gt;
      );
    } else {
      return (
        &lt;div className=&quot;hi&quot; id=&quot;hiId&quot;&gt;
          Hi
        &lt;/div&gt;
      );
    }
  }
  
  export { Foo };
  </code></pre>
  <p><code>foo.spec.js</code>:</p>
  <pre class="lang-js prettyprint-override"><code>describe('check foo Component', () =&gt; {
    describe('without data', () =&gt; {
      const mount = shallow(&lt;Foo data={false} /&gt;);
      it('data is false', () =&gt; {
        expect(mount.contains('hello')).toBeNull();
      });
    });
    describe('without data', () =&gt; {
      const mount = shallow(&lt;Foo data={true} /&gt;);
      it('data is true', () =&gt; {
        expect(mount.contains('hello')).toBeNull();
      });
    });
  });
  </code></pre>
  <p>In both the test cases I'm getting false. It must be true in one case and false in another. Getting error in the console</p>
  <blockquote>
  <p>is only meant to be run on a single node. 0 found instead.</p>
  </blockquote>
  <p>if any element is not defined.</p>
  <p>How to write test cases for both the scenarios?</p>