title: How to test a function is called in react jest?
body: <p>I have my button inside a component, which calls a method deleteData on click.
  How do I test the deleteData method is called on the button click in jest?</p>
  
  <pre><code>&lt;Modal.Footer&gt;
    &lt;Button id="trashBtn" onClick={this.deleteData}&gt;Delete&lt;/Button&gt;
  &lt;Modal.Footer&gt;
  
  deleteData() {
      {/* TODO :*/}
    }
  </code></pre>