diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-04 00:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-04 00:09:24 +0300 |
commit | 9432ed811233643af1cb5ad78e2cd9755ed989a9 (patch) | |
tree | a6f4d254ebd818a58017b3bfb0911f4aae169fcf /spec/frontend/import_entities | |
parent | 44434461b3c58336624125b5ab002e7200e4a208 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/import_entities')
-rw-r--r-- | spec/frontend/import_entities/import_groups/components/import_table_spec.js | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/spec/frontend/import_entities/import_groups/components/import_table_spec.js b/spec/frontend/import_entities/import_groups/components/import_table_spec.js index a0115cb9349..61f860688dc 100644 --- a/spec/frontend/import_entities/import_groups/components/import_table_spec.js +++ b/spec/frontend/import_entities/import_groups/components/import_table_spec.js @@ -1,10 +1,11 @@ -import { GlAlert, GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; +import { GlAlert, GlEmptyState, GlIcon, GlLoadingIcon } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; import MockAdapter from 'axios-mock-adapter'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; +import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createAlert } from '~/flash'; import httpStatus from '~/lib/utils/http_status'; import axios from '~/lib/utils/axios_utils'; @@ -50,6 +51,7 @@ describe('import table', () => { rowWrapper.find('[data-testid="target-namespace-selector"]'); const findPaginationDropdownText = () => findPaginationDropdown().find('button').text(); const findSelectionCount = () => wrapper.find('[data-test-id="selection-count"]'); + const findNewPathCol = () => wrapper.find('[data-test-id="new-path-col"]'); const triggerSelectAllCheckbox = (checked = true) => wrapper.find('thead input[type=checkbox]').setChecked(checked); @@ -76,6 +78,9 @@ describe('import table', () => { historyPath: '/fake_history_path', defaultTargetNamespace, }, + directives: { + GlTooltip: createMockDirective(), + }, apolloProvider, }); }; @@ -540,6 +545,26 @@ describe('import table', () => { ); }); + it('displays info icon with a tooltip', async () => { + const NEW_GROUPS = [generateFakeEntry({ id: 1, status: STATUSES.NONE })]; + + createComponent({ + bulkImportSourceGroups: () => ({ + nodes: NEW_GROUPS, + pageInfo: FAKE_PAGE_INFO, + versionValidation: FAKE_VERSION_VALIDATION, + }), + }); + jest.spyOn(apolloProvider.defaultClient, 'mutate'); + await waitForPromises(); + + const icon = findNewPathCol().findComponent(GlIcon); + const tooltip = getBinding(icon.element, 'gl-tooltip'); + + expect(tooltip).toBeDefined(); + expect(tooltip.value).toBe('Path of the new group.'); + }); + describe('unavailable features warning', () => { it('renders alert when there are unavailable features', async () => { createComponent({ |