diff options
Diffstat (limited to 'spec/frontend/whats_new/store')
-rw-r--r-- | spec/frontend/whats_new/store/actions_spec.js | 17 | ||||
-rw-r--r-- | spec/frontend/whats_new/store/mutations_spec.js | 25 |
2 files changed, 42 insertions, 0 deletions
diff --git a/spec/frontend/whats_new/store/actions_spec.js b/spec/frontend/whats_new/store/actions_spec.js new file mode 100644 index 00000000000..d95453c9175 --- /dev/null +++ b/spec/frontend/whats_new/store/actions_spec.js @@ -0,0 +1,17 @@ +import testAction from 'helpers/vuex_action_helper'; +import actions from '~/whats_new/store/actions'; +import * as types from '~/whats_new/store/mutation_types'; + +describe('whats new actions', () => { + describe('openDrawer', () => { + it('should commit openDrawer', () => { + testAction(actions.openDrawer, {}, {}, [{ type: types.OPEN_DRAWER }]); + }); + }); + + describe('closeDrawer', () => { + it('should commit closeDrawer', () => { + testAction(actions.closeDrawer, {}, {}, [{ type: types.CLOSE_DRAWER }]); + }); + }); +}); diff --git a/spec/frontend/whats_new/store/mutations_spec.js b/spec/frontend/whats_new/store/mutations_spec.js new file mode 100644 index 00000000000..3c33364fed3 --- /dev/null +++ b/spec/frontend/whats_new/store/mutations_spec.js @@ -0,0 +1,25 @@ +import mutations from '~/whats_new/store/mutations'; +import createState from '~/whats_new/store/state'; +import * as types from '~/whats_new/store/mutation_types'; + +describe('whats new mutations', () => { + let state; + + beforeEach(() => { + state = createState; + }); + + describe('openDrawer', () => { + it('sets open to true', () => { + mutations[types.OPEN_DRAWER](state); + expect(state.open).toBe(true); + }); + }); + + describe('closeDrawer', () => { + it('sets open to false', () => { + mutations[types.CLOSE_DRAWER](state); + expect(state.open).toBe(false); + }); + }); +}); |