gitlab-org--gitlab-foss/spec/javascripts/vuex_shared/modules/modal/actions_spec.js
Paul Slaughter 708df374f5
Create shared gl-modal-vuex component and module
**Why?**
It is significantly easier to manage the visibility of the modal in
Vuex. The module contains the state and mutations to manage this.
The component wraps GlModal and syncs the visibility with the module.
2019-01-03 23:34:15 -06:00

31 lines
865 B
JavaScript

import * as types from '~/vuex_shared/modules/modal/mutation_types';
import * as actions from '~/vuex_shared/modules/modal/actions';
import testAction from 'spec/helpers/vuex_action_helper';
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);
});
});
});