Skip to content
Snippets Groups Projects
Commit 399baf37 authored by Martin Wortschack's avatar Martin Wortschack :red_circle:
Browse files

Add specs

parent bebfefc6
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !101914. Comments created here will be created in the context of that merge request.
...@@ -669,12 +669,14 @@ export default { ...@@ -669,12 +669,14 @@ export default {
/> />
</template> </template>
<template #head(importTarget)="data"> <template #head(importTarget)="data">
<span class="gl-mr-2">{{ data.label }}</span <span data-test-id="new-path-col">
><gl-icon <span class="gl-mr-2">{{ data.label }}</span
v-gl-tooltip="s_('BulkImport|The path of the new group.')" ><gl-icon
name="information" v-gl-tooltip="s__('BulkImport|The path of the new group.')"
:size="12" name="information"
/> :size="12"
/>
</span>
</template> </template>
<template #cell(selected)="{ rowSelected, selectRow, unselectRow, item: group }"> <template #cell(selected)="{ rowSelected, selectRow, unselectRow, item: group }">
<gl-form-checkbox <gl-form-checkbox
......
import { GlAlert, GlEmptyState, GlLoadingIcon } from '@gitlab/ui'; import { GlAlert, GlEmptyState, GlIcon, GlLoadingIcon } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue'; import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import { createAlert } from '~/flash'; import { createAlert } from '~/flash';
import httpStatus from '~/lib/utils/http_status'; import httpStatus from '~/lib/utils/http_status';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -50,6 +51,7 @@ describe('import table', () => { ...@@ -50,6 +51,7 @@ describe('import table', () => {
rowWrapper.find('[data-testid="target-namespace-selector"]'); rowWrapper.find('[data-testid="target-namespace-selector"]');
const findPaginationDropdownText = () => findPaginationDropdown().find('button').text(); const findPaginationDropdownText = () => findPaginationDropdown().find('button').text();
const findSelectionCount = () => wrapper.find('[data-test-id="selection-count"]'); const findSelectionCount = () => wrapper.find('[data-test-id="selection-count"]');
const findNewPathCol = () => wrapper.find('[data-test-id="new-path-col"]');
const triggerSelectAllCheckbox = (checked = true) => const triggerSelectAllCheckbox = (checked = true) =>
wrapper.find('thead input[type=checkbox]').setChecked(checked); wrapper.find('thead input[type=checkbox]').setChecked(checked);
...@@ -76,6 +78,9 @@ describe('import table', () => { ...@@ -76,6 +78,9 @@ describe('import table', () => {
historyPath: '/fake_history_path', historyPath: '/fake_history_path',
defaultTargetNamespace, defaultTargetNamespace,
}, },
directives: {
GlTooltip: createMockDirective(),
},
apolloProvider, apolloProvider,
}); });
}; };
...@@ -540,6 +545,28 @@ describe('import table', () => { ...@@ -540,6 +545,28 @@ 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('The path of the new group.');
});
describe('unavailable features warning', () => { describe('unavailable features warning', () => {
it('renders alert when there are unavailable features', async () => { it('renders alert when there are unavailable features', async () => {
createComponent({ createComponent({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment