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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-08 12:09:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-08 12:09:42 +0300
commitf4ea1f8998fd64bcd02280514b91f103f830d5ce (patch)
tree14ff4a76b07da90dbaa9c75398b3bd2a79ac85c6 /spec/frontend/notes/stores
parentae192a2f1410b5f71397a64df76238b9d3b0afbe (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes/stores')
-rw-r--r--spec/frontend/notes/stores/actions_spec.js24
-rw-r--r--spec/frontend/notes/stores/mutation_spec.js12
2 files changed, 36 insertions, 0 deletions
diff --git a/spec/frontend/notes/stores/actions_spec.js b/spec/frontend/notes/stores/actions_spec.js
index ecb213590ad..4ecfbc5de1f 100644
--- a/spec/frontend/notes/stores/actions_spec.js
+++ b/spec/frontend/notes/stores/actions_spec.js
@@ -1382,6 +1382,29 @@ describe('Actions Notes Store', () => {
],
);
});
+
+ it('dispatches `fetchDiscussionsBatch` action if `paginatedMrDiscussions` feature flag is enabled', () => {
+ window.gon = { features: { paginatedMrDiscussions: true } };
+
+ return testAction(
+ actions.fetchDiscussions,
+ { path: 'test-path', filter: 'test-filter', persistFilter: 'test-persist-filter' },
+ null,
+ [],
+ [
+ {
+ type: 'fetchDiscussionsBatch',
+ payload: {
+ config: {
+ params: { notes_filter: 'test-filter', persist_filter: 'test-persist-filter' },
+ },
+ path: 'test-path',
+ perPage: 20,
+ },
+ },
+ ],
+ );
+ });
});
describe('fetchDiscussionsBatch', () => {
@@ -1401,6 +1424,7 @@ describe('Actions Notes Store', () => {
null,
[
{ type: mutationTypes.ADD_OR_UPDATE_DISCUSSIONS, payload: { discussion } },
+ { type: mutationTypes.SET_DONE_FETCHING_BATCH_DISCUSSIONS, payload: true },
{ type: mutationTypes.SET_FETCHING_DISCUSSIONS, payload: false },
],
[{ type: 'updateResolvableDiscussionsCounts' }],
diff --git a/spec/frontend/notes/stores/mutation_spec.js b/spec/frontend/notes/stores/mutation_spec.js
index da1547ab6e7..e0a0fc43ffe 100644
--- a/spec/frontend/notes/stores/mutation_spec.js
+++ b/spec/frontend/notes/stores/mutation_spec.js
@@ -883,4 +883,16 @@ describe('Notes Store mutations', () => {
expect(state.discussions[0].position).toEqual(position);
});
});
+
+ describe('SET_DONE_FETCHING_BATCH_DISCUSSIONS', () => {
+ it('should set doneFetchingBatchDiscussions', () => {
+ const state = {
+ doneFetchingBatchDiscussions: false,
+ };
+
+ mutations.SET_DONE_FETCHING_BATCH_DISCUSSIONS(state, true);
+
+ expect(state.doneFetchingBatchDiscussions).toEqual(true);
+ });
+ });
});