title: React js test boolean prop with Jest
body: <p>New to testing, so not I'm sure how to approach this. I have a bool <code>prop</code> in my component that determines the <code>className</code> of an element. The Boolean is set whether the form is valid or not showing the <code>div</code> containing an error message</p>
  
  <pre><code>&lt;div&gt;
     &lt;div className={!this.props.isValid ? 'login__error error' : 'hidden'}&gt;
        ...
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How to test this in Jest?</p>
  
  <p>Thanks in advance</p>
  
  <p>UPDATE:
  Following the answer by @hemerson-carlin here's my test. But keeps failing  with <code>RangeError: Invalid string length</code> not sure why.</p>
  
  <pre><code>describe('Given invalid details the form should display an error', () =&gt; {
    let component
  
    beforeEach(() =&gt; {
      component = mount(&lt;Login /&gt;)
    })
  
    it('should render valid mode', () =&gt; {
      component.setProps({ isValid: true })
      console.log(component.props())
  
      expect(component).toMatchSnapshot()
    })
  
    it('should render invalid mode', () =&gt; {
      component.setProps({ isValid: false })
      console.log(component.props())
  
      expect(component).toMatchSnapshot()
    })
  
  })
  </code></pre>