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>2023-12-19 14:01:45 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-19 14:01:45 +0300
commit9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch)
tree865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/frontend/import_entities/import_projects/store/actions_spec.js
parent6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff)
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/frontend/import_entities/import_projects/store/actions_spec.js')
-rw-r--r--spec/frontend/import_entities/import_projects/store/actions_spec.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/frontend/import_entities/import_projects/store/actions_spec.js b/spec/frontend/import_entities/import_projects/store/actions_spec.js
index 3b94db37801..918821dfa59 100644
--- a/spec/frontend/import_entities/import_projects/store/actions_spec.js
+++ b/spec/frontend/import_entities/import_projects/store/actions_spec.js
@@ -17,6 +17,7 @@ import {
SET_PAGE,
SET_FILTER,
SET_PAGE_CURSORS,
+ SET_HAS_NEXT_PAGE,
} from '~/import_entities/import_projects/store/mutation_types';
import state from '~/import_entities/import_projects/store/state';
import axios from '~/lib/utils/axios_utils';
@@ -143,6 +144,44 @@ describe('import_projects store actions', () => {
);
});
});
+
+ describe('when provider is BITBUCKET_SERVER', () => {
+ beforeEach(() => {
+ localState.provider = PROVIDERS.BITBUCKET_SERVER;
+ });
+
+ describe.each`
+ reposLength | expectedHasNextPage
+ ${0} | ${false}
+ ${12} | ${false}
+ ${20} | ${false}
+ ${25} | ${true}
+ `('when reposLength is $reposLength', ({ reposLength, expectedHasNextPage }) => {
+ beforeEach(() => {
+ payload.provider_repos = Array(reposLength).fill({});
+
+ mock.onGet(MOCK_ENDPOINT).reply(HTTP_STATUS_OK, payload);
+ });
+
+ it('commits SET_HAS_NEXT_PAGE', () => {
+ return testAction(
+ fetchRepos,
+ null,
+ localState,
+ [
+ { type: REQUEST_REPOS },
+ { type: SET_PAGE, payload: 1 },
+ { type: SET_HAS_NEXT_PAGE, payload: expectedHasNextPage },
+ {
+ type: RECEIVE_REPOS_SUCCESS,
+ payload: convertObjectPropsToCamelCase(payload, { deep: true }),
+ },
+ ],
+ [],
+ );
+ });
+ });
+ });
});
it('commits REQUEST_REPOS, RECEIVE_REPOS_ERROR mutations on an unsuccessful request', () => {