title: Test Vue components using Jest and vue-utils
body: <p>I am trying to test a component been called in vue using jest and vue-utils but it is giving the error below</p>
  
  <pre><code>expect(jest.fn()).toHaveBeenCalled()
  
   Expected mock function to have been called, but it was not called.
  </code></pre>
  
  <p><code>RandomPhoneNumber component</code> The component makes use of ant-design-vue UI</p>
  
  <pre><code>       &lt;div&gt;
            &lt;a-button
              type="primary"
              @click="generatePhone"
              size="large"
              class="btn-generate"
            &gt;Generate Phone Numbers&lt;/a-button&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>What I have done is below</p>
  
  <pre><code>it('should call generatePhone', () =&gt; {
      const wrapper = mount(RandomPhoneNumber, {
        localVue,
        sync: false
      })
  
      const spy = jest.fn()
      wrapper.vm.generatePhone = spy
      const button = wrapper.find('.btn-generate')
      button.trigger('click')
      expect(wrapper.vm.generatePhone).toHaveBeenCalled()
    })
  </code></pre>
  
  <p>Can anybody share more light on this and what am I doing wrong here.</p>