title: React unit testing, checking if checkbox is checked
body: <p>I am trying to build some unit tests for my react code using chai. I seem to be having some trouble targeting and checking if a checkbox is checked and am unsure why. I have tried 2 methods so far : </p>
  
  <p>The first is this : </p>
  
  <pre><code>let Element;
  
  describe('Search Filters Filter Component', () =&gt; {
    beforeEach(function() {
      Element = TestUtils.renderIntoDocument(&lt;searchFiltersFilterComponent filterGroup={filterGroup} filter={filter} /&gt;);
  });
  
  it('renders the search-filters-filter component', () =&gt; {
      expect(Element).not.to.be.undefined();
  });
  
   it('is checked when provided with correct object', () =&gt; {
      const domNode = ReactDOM.findDOMNode(Element);
      const input = domNode.querySelector('input');
      console.log("checkbox?", input);
      //expect(element(input.isSelected()).to.be.true();
  });
  
  });
  </code></pre>
  
  <p>Right now this is not working, the input is logging as null. The second method I tried was this :</p>
  
  <pre><code>it('is checked when provided with correct object', () =&gt; {
  
      const CheckBox = TestUtils.findRenderedDOMComponentWithClass(Element, 'singleFiltersFilterInput');
      console.log("checkbox?", CheckBox);
      //expect(element(by.model(el)).isSelected()).to.be.true();
  });
  </code></pre>
  
  <p>And this one is giving me an error of : <code>Invariant Violation: findAllInRenderedTree(...): instance must be a composite component</code> </p>
  
  <p>I am stumped as to how to target and check if the checkbox is checked properly, I was going to just say <code>expect(element(input.isSelected()).to.be.true();</code>, however I cannot seem to target the checkbox on the test render properly. Any advice would be greatly appreciated, thanks!</p>
  
  <p><em>Update</em> :</p>
  
  <p>so it seems that capitalizing the <code>SearchFiltersFilterComponent</code> was one of my issues, one i fixed that, I can now see the component correctly using  : </p>
  
  <pre><code>  const CheckBox = TestUtils.findRenderedDOMComponentWithClass(Element, 'singleFiltersFilterInput');
    console.log("checkbox?", CheckBox);
    expect(CheckBox.is.selected()).to.be.true();
  </code></pre>
  
  <p>However, that assertion is not correct. So I am wondering what the correct way to see assert that the checkedbox is checked is? I can see in the log it has a <code>_checkness</code> value, so I could do <code>CheckBox._checkness</code>, but i would prefer if there was an assertion that did this instead. Any advice is greatly appreciated!</p>