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/groups_projects/components/transfer_locations_spec.js')
-rw-r--r--spec/frontend/groups_projects/components/transfer_locations_spec.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/frontend/groups_projects/components/transfer_locations_spec.js b/spec/frontend/groups_projects/components/transfer_locations_spec.js
index 74424ee3230..77c0966ba1e 100644
--- a/spec/frontend/groups_projects/components/transfer_locations_spec.js
+++ b/spec/frontend/groups_projects/components/transfer_locations_spec.js
@@ -15,7 +15,7 @@ import { mountExtended } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
import createMockApollo from 'helpers/mock_apollo_helper';
import { __ } from '~/locale';
-import TransferLocations from '~/groups_projects/components/transfer_locations.vue';
+import TransferLocations, { i18n } from '~/groups_projects/components/transfer_locations.vue';
import { getTransferLocations } from '~/api/projects_api';
import currentUserNamespaceQuery from '~/projects/settings/graphql/queries/current_user_namespace.query.graphql';
@@ -374,4 +374,23 @@ describe('TransferLocations', () => {
expect(wrapper.findByRole('group', { name: label }).exists()).toBe(true);
});
});
+
+ describe('when there are no results', () => {
+ it('displays no results message', async () => {
+ mockResolvedGetTransferLocations({
+ data: [],
+ page: '1',
+ nextPage: null,
+ total: '0',
+ totalPages: '1',
+ prevPage: null,
+ });
+
+ createComponent({ propsData: { showUserTransferLocations: false } });
+
+ await showDropdown();
+
+ expect(wrapper.findComponent(GlDropdownItem).text()).toBe(i18n.NO_RESULTS_TEXT);
+ });
+ });
});