title: What exactly should I test when calling React's this.props.onClick(this) in Jest?
body: <p>I've been writing tests for all my events (and everything else of course) but I'm at a loss on how to test that this.props.onClick(this) was called on a child component. </p>
  
  <p>My child component has the following code:</p>
  
  <pre><code>closeModal: function() {
    this.props.onClick(this);
  },
  
  render: function() {
    return (
      &lt;i className="close-icon" onClick={this.closeModal}&gt;&lt;/i&gt;
    )
  }
  </code></pre>
  
  <p>and the parent is listening to it like so:</p>
  
  <pre><code>onCloseModal: function() {
    this.replaceState({
      modalStatus: 'hidden'
    });
  },
  
  render: function() {
    return (
      &lt;QuestionModal modalStatus={this.state.modalStatus} onClick={this.onCloseModal} /&gt;
    )
  }
  </code></pre>
  
  <p>I know how to test the parent's click event and I know how to call the child's button click event in the tests as well but I'm not sure what I should be exactly testing. </p>
  
  <p>If I used Sinon and Jasmine, I would stub the closeModal method and check that it was called. Can I do that with Jest and if so how exactly?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've tried writing a test based on @PhilVarg's answer but I'm not getting very far as I'm not able to mock <em>closeModal</em>.</p>
  
  <p>Here's my test:</p>
  
  <pre><code>      var closeIcon,
            myMock = jest.genMockFunction();
  
        form = TestUtils.renderIntoDocument(
          &lt;QuestionForm /&gt;
        );
        form.closeModal = myMock;
  
        closeIcon = TestUtils.findRenderedDOMComponentWithClass(form, 'close-icon');
  
        TestUtils.Simulate.click(closeIcon);
  
        expect(form.closeModal).toBeCalled();
  </code></pre>
  
  <p>The test errors with <em>Expected Function to be called.</em> and closeModal is not mocked but still runs (I have a console log in it at the moment). I've been on it all afternoon but haven't been able to figure it out. Any help would be very appreciated. </p>