debian-mirror-gitlab/spec/frontend/whats_new/store/mutations_spec.js

33 lines
818 B
JavaScript
Raw Normal View History

2020-10-24 23:57:45 +05:30
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);
});
});
2021-01-03 14:25:43 +05:30
describe('setFeatures', () => {
it('sets features to data', () => {
mutations[types.SET_FEATURES](state, 'bells and whistles');
expect(state.features).toBe('bells and whistles');
});
});
2020-10-24 23:57:45 +05:30
});