title: Jest expected mock function to have been called on testing vuex actions in vue-multiselect
body: <p>i have problems to test a dispatch action in v-model of component.
  I have a multiselect and every time when a values changes a dispatch action is fired,
  because the selected value is stored in na Vuex store.
  I want to test that dispatch action has been called after a value has been selected in multiselect.</p>
  
  <pre><code>&lt;multiselect
        v-model="subdivision"
        :options="options"
        :multiple="false"
        :close-on-select="true"
        :clear-on-select="false"
        :preserve-search="false"
        placeholder="Please select"
        label="name"
        track-by="name"
        :preselect-first="false"
        selectedLabel="✓"
        deselectLabel="×"
        selectLabel=" "
        ref="myMultiselect"
        id="multiselectId"
      &gt;&lt;/multiselect&gt;
  
       computed: {
         subdivision: {
           set(value) {
             this.$store.dispatch("subdivision", value);
         },
          get(value) {
             return this.$store.state.subdivision;
         }
       }
      }
  </code></pre>
  
  <p>Thats the test:</p>
  
  <pre><code>describe('Value change of subdivision', () =&gt; {
    let multiselect;
    let cmp2;
    let actions;
    let mutations;
    let state;
    let getters;
  
    beforeEach(() =&gt; {
      actions = {
        subdivision: jest.fn()
      };
      state = storeConfig.state;
      mutations = storeConfig.mutations;
      getters = storeConfig.getters;
      store = new Vuex.Store({ state, getters, mutations, actions });
  
      cmp2 = shallowMount(MyComponent, {
        store,
        localVue,
        router
      });
    })
  
    it('Select value should dispatch action', () =&gt; {
      let multiselect = cmp2.find({ ref: 'myMultiselect' });
      multiselect.trigger('input',subdivisions[1]);
      expect(actions.subdivision).toHaveBeenCalled();
    })
  })
  </code></pre>
  
  <p>Its not working.
  I get the following error.</p>
  
  <pre><code>expect(jest.fn()).toHaveBeenCalled()
  Expected mock function to have been called.
  </code></pre>
  
  <p>What is wrong?
  Please help.</p>