diff options
Diffstat (limited to 'spec/javascripts/diffs/store/mutations_spec.js')
-rw-r--r-- | spec/javascripts/diffs/store/mutations_spec.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/javascripts/diffs/store/mutations_spec.js b/spec/javascripts/diffs/store/mutations_spec.js index 270e7d75666..5556a994a14 100644 --- a/spec/javascripts/diffs/store/mutations_spec.js +++ b/spec/javascripts/diffs/store/mutations_spec.js @@ -58,13 +58,15 @@ describe('DiffsStoreMutations', () => { describe('EXPAND_ALL_FILES', () => { it('should change the collapsed prop from diffFiles', () => { const diffFile = { - collapsed: true, + viewer: { + collapsed: true, + }, }; const state = { expandAllFiles: true, diffFiles: [diffFile] }; mutations[types.EXPAND_ALL_FILES](state); - expect(state.diffFiles[0].collapsed).toEqual(false); + expect(state.diffFiles[0].viewer.collapsed).toEqual(false); }); }); @@ -742,4 +744,16 @@ describe('DiffsStoreMutations', () => { expect(state.diffFiles[0].isShowingFullFile).toBe(true); }); }); + + describe('SET_FILE_COLLAPSED', () => { + it('sets collapsed', () => { + const state = { + diffFiles: [{ file_path: 'test', viewer: { collapsed: false } }], + }; + + mutations[types.SET_FILE_COLLAPSED](state, { filePath: 'test', collapsed: true }); + + expect(state.diffFiles[0].viewer.collapsed).toBe(true); + }); + }); }); |