Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/diffs/store/mutations_spec.js')
-rw-r--r--spec/frontend/diffs/store/mutations_spec.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/frontend/diffs/store/mutations_spec.js b/spec/frontend/diffs/store/mutations_spec.js
index 13e7cad835d..2c342d8e2a5 100644
--- a/spec/frontend/diffs/store/mutations_spec.js
+++ b/spec/frontend/diffs/store/mutations_spec.js
@@ -105,7 +105,7 @@ describe('DiffsStoreMutations', () => {
describe('SET_COVERAGE_DATA', () => {
it('should set coverage data properly', () => {
const state = { coverageFiles: {} };
- const coverage = { 'app.js': { '1': 0, '2': 1 } };
+ const coverage = { 'app.js': { 1: 0, 2: 1 } };
mutations[types.SET_COVERAGE_DATA](state, coverage);
@@ -906,4 +906,19 @@ describe('DiffsStoreMutations', () => {
expect(state.viewDiffsFileByFile).toBe(value);
});
});
+
+ describe('SET_MR_FILE_REVIEWS', () => {
+ it.each`
+ newReviews | oldReviews
+ ${{ abc: ['123'] }} | ${{}}
+ ${{ abc: [] }} | ${{ abc: ['123'] }}
+ ${{}} | ${{ abc: ['123'] }}
+ `('sets mrReviews to $newReviews', ({ newReviews, oldReviews }) => {
+ const state = { mrReviews: oldReviews };
+
+ mutations[types.SET_MR_FILE_REVIEWS](state, newReviews);
+
+ expect(state.mrReviews).toStrictEqual(newReviews);
+ });
+ });
});