diff options
Diffstat (limited to 'spec/frontend/diffs/store/mutations_spec.js')
-rw-r--r-- | spec/frontend/diffs/store/mutations_spec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/frontend/diffs/store/mutations_spec.js b/spec/frontend/diffs/store/mutations_spec.js index f486a53fc4d..ad05f27b325 100644 --- a/spec/frontend/diffs/store/mutations_spec.js +++ b/spec/frontend/diffs/store/mutations_spec.js @@ -51,6 +51,24 @@ describe('DiffsStoreMutations', () => { }); }); + describe('SET_DIFF_FILES', () => { + it('should set diffFiles in state', () => { + const state = {}; + + mutations[types.SET_DIFF_FILES](state, ['file', 'another file']); + + expect(state.diffFiles.length).toEqual(2); + }); + + it('should not set anything except diffFiles in state', () => { + const state = {}; + + mutations[types.SET_DIFF_FILES](state, ['file', 'another file']); + + expect(Object.keys(state)).toEqual(['diffFiles']); + }); + }); + describe('SET_DIFF_DATA', () => { it('should set diff data type properly', () => { const state = { |