summaryrefslogtreecommitdiff
path: root/spec/frontend/vuex_shared/modules/modal/actions_spec.js
blob: 353dbcb522f4267f1e8469b68b9d8923b5fc78de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import testAction from 'helpers/vuex_action_helper';
import * as types from '~/vuex_shared/modules/modal/mutation_types';
import * as actions from '~/vuex_shared/modules/modal/actions';

describe('Vuex ModalModule actions', () => {
  describe('open', () => {
    it('works', done => {
      const data = { id: 7 };

      testAction(actions.open, data, {}, [{ type: types.OPEN, payload: data }], [], done);
    });
  });

  describe('close', () => {
    it('works', done => {
      testAction(actions.close, null, {}, [{ type: types.CLOSE }], [], done);
    });
  });

  describe('show', () => {
    it('works', done => {
      testAction(actions.show, null, {}, [{ type: types.SHOW }], [], done);
    });
  });

  describe('hide', () => {
    it('works', done => {
      testAction(actions.hide, null, {}, [{ type: types.HIDE }], [], done);
    });
  });
});