diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/frontend/diffs/store/mutations_spec.js | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/frontend/diffs/store/mutations_spec.js')
-rw-r--r-- | spec/frontend/diffs/store/mutations_spec.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/frontend/diffs/store/mutations_spec.js b/spec/frontend/diffs/store/mutations_spec.js index fc9ba223d5a..c104fcd5fb9 100644 --- a/spec/frontend/diffs/store/mutations_spec.js +++ b/spec/frontend/diffs/store/mutations_spec.js @@ -633,16 +633,36 @@ describe('DiffsStoreMutations', () => { }); }); - describe('VIEW_DIFF_FILE', () => { + describe('SET_CURRENT_DIFF_FILE', () => { it('updates currentDiffFileId', () => { const state = createState(); - mutations[types.VIEW_DIFF_FILE](state, 'somefileid'); + mutations[types.SET_CURRENT_DIFF_FILE](state, 'somefileid'); expect(state.currentDiffFileId).toBe('somefileid'); }); }); + describe('SET_DIFF_FILE_VIEWED', () => { + let state; + + beforeEach(() => { + state = { + viewedDiffFileIds: { 123: true }, + }; + }); + + it.each` + id | bool | outcome + ${'abc'} | ${true} | ${{ 123: true, abc: true }} + ${'123'} | ${false} | ${{ 123: false }} + `('sets the viewed files list to $bool for the id $id', ({ id, bool, outcome }) => { + mutations[types.SET_DIFF_FILE_VIEWED](state, { id, seen: bool }); + + expect(state.viewedDiffFileIds).toEqual(outcome); + }); + }); + describe('Set highlighted row', () => { it('sets highlighted row', () => { const state = createState(); |