title: Trigger event in Jest Test does not call Method
body: <p>I am currently writing tests for my Vue application. I have a button which calls a logout function. I just want to test if the function gets called when the button gets clicked.</p>
  
  <p>I have tried to mock the function with jest.fn() but i cant get it to work. I also tried to actually trigger the method and put a console.log in the method but that log did not get called. What am I doing wrong?</p>
  
  <p>this is my wrapper setup:</p>
  
  <pre><code>let wrapper;
  
  beforeEach(() =&gt; {
      Vue.use(Vuetify);
      Vue.prototype.$router = new VueRouter();
      wrapper = shallowMount(Navigation);
  });
  
  afterEach(() =&gt; {
      wrapper.destroy();
  });
  
  </code></pre>
  
  <pre><code>it('should call logout function on button click', function() {
          let submitLogoutMock = jest.fn();
          wrapper.vm.submitLogout = submitLogoutMock;
  
          wrapper
              .find('#logout-button')
              .trigger('click');
  
          expect(submitLogoutMock).toHaveBeenCalled();
      });
  </code></pre>
  
  <p>I expect the mocked method to be called but actually i get an error saying:</p>
  
  <pre><code>Error: expect(jest.fn()).toHaveBeenCalled()
  
  Expected mock function to have been called, but it was not called.
  </code></pre>