title: Mocking a function call inside a function in Jest
body: <p>I have a function <code>getBookingStateObject</code> that calls another function <code>getBookingStateButtons</code>. In turn <code>getBookingStateButtons</code> calls two other functions <code>linkButtons</code> and <code>sendEventButtons</code>. </p>
  
  <p>I'm trying to write tests for the above scenario. I have the following in my test file. </p>
  
  <pre><code>import {
    getBookingStateButtons,
    getBookingStateObject,
    linkButtons,
    sendEventButtons,
  } from './bookingStates'
  
  jest.mock('getBookingStateButtons', () =&gt; jest.fn())
  jest.mock('linkButtons', () =&gt; jest.fn())
  jest.mock('sendEventButtons', () =&gt; jest.fn())
  
  it('calls getBookingStateButtons, linkButtons, sendEventButtons', () =&gt; {
      getBookingStateObject({ aasm_state: 'created' }, '123')
      expect(getBookingStateButtons).toHaveBeenCalledWith({
        bookingId: '123',
        events: [{ event: 'mark_requested', type: 'secondary' }],
        links: [{ to: 'edit' }],
      })
      expect(linkButtons).toHaveBeenCalledWith({
        to: 'edit',
        type: 'secondary',
      })
      expect(sendEventButtons).toHaveBeenCalledWith({
        event: 'mark_requested',
        type: 'secondary',
      })
    })
  </code></pre>
  
  <p>When I run the tests I get the following error:
  <code>Cannot find module 'getBookingStateButtons' from 'bookingStates.spec.tsx'</code> </p>
  
  <p>I'm new to jest, What am I doing wrong?</p>