title: How to test button click on jest/enzyme without props
body: <p>I want to test is the button clicked and some actions happens but I fail the test and receive 0 number of calls when clicked. Im not passing onclick function from props.
  I'm using materialUi Button</p>
  <pre><code>const LoginFunction = () =&gt; {
  
    const handleClick = () =&gt; {
      console.log('some action here')
    };
  
    return (
      &lt;Button
          data-test=&quot;btn&quot;
          className='btn'
          onClick={() =&gt; {
              handleClick();
          }}
      &gt;
         Some text
      &lt;/Button&gt;
   )};
  </code></pre>
  <p>I wrote test like this</p>
  <pre><code>describe('Test Login component', () =&gt; {
  
    it('should trigger click event', () =&gt; {
      const mockCallBack = jest.fn();
      const wrapper = shallow(&lt;LoginFunction /&gt;);
  
      wrapper.simulate('click');
      expect(mockCallBack.mock.calls.length).toBe(1);
     }); 
   });
  </code></pre>
  <p>Tried this way too</p>
  <pre><code> describe('Test Login component', () =&gt; {
  
    it('should trigger click event', () =&gt; {
      const mockCallBack = jest.fn();
      const wrapper = shallow(&lt;LoginFunction /&gt;);
  
      wrapper.find('.btn').simulate('click');
      expect(mockCallBack.mock.calls.length).toBe(1);
     }); 
   });
  </code></pre>