title: How to test onClick props of a button using Jest and Enzyme
body: <p>I am trying to test a button which has an onClick function in React. My button looks like this:</p>
  
  <pre><code>&lt;button 
            id='emailButton'
            className={classes.sceContactHeaderButton}
            data-toggle='collapse'
            data-target='#editEmailContact'
            onClick={props.handleToggle}
            tabIndex={0}
            title={(props.email.isOpen) ? 'Close Section' : 'Open Section'}
          &gt;
            &lt;span&gt;{(props.email.isOpen) ? 'Close' : 'Details'}&lt;/span&gt;
            &lt;i className={(props.email.isOpen) ? 'fa fa-angle-up' : 'fa fa-angle-down'} /&gt;
          &lt;/button&gt;
  </code></pre>
  
  <p>My test for the onClick() method is :</p>
  
  <pre><code>  it('check if the onClick method of the button exists', () =&gt; {
          wrapper.find('#emailButton').children().at(0).prop('onClick')();
      });
  </code></pre>
  
  <p>But I am getting an error saying: </p>
  
  <p><code>TypeError: wrapper.find(...).children(...).at(...).prop(...) is not a function</code></p>
  
  <p>What am I doing wrong? Any help is greatly appreciated.</p>