diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-04 21:08:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-04 21:08:35 +0300 |
commit | e15501a5e1f54249434167c0198dab775bdc4a1f (patch) | |
tree | 15615908225f23633fa269c063de38d38f88c38a /spec/frontend/import_entities | |
parent | 856e2c64ee69b055b31a8ebbeee616f13a46505e (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 | 30 |
1 files changed, 29 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 3bef793f2c3..1939e43e5dc 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 @@ -9,7 +9,7 @@ import createFlash from '~/flash'; import httpStatus from '~/lib/utils/http_status'; import axios from '~/lib/utils/axios_utils'; import { STATUSES } from '~/import_entities/constants'; -import { i18n } from '~/import_entities/import_groups/constants'; +import { i18n, ROOT_NAMESPACE } from '~/import_entities/import_groups/constants'; import ImportTable from '~/import_entities/import_groups/components/import_table.vue'; import importGroupsMutation from '~/import_entities/import_groups/graphql/mutations/import_groups.mutation.graphql'; import PaginationLinks from '~/vue_shared/components/pagination_links.vue'; @@ -45,6 +45,8 @@ describe('import table', () => { const findImportButtons = () => wrapper.findAll('button').wrappers.filter((w) => w.text() === 'Import'); const findPaginationDropdown = () => wrapper.find('[data-testid="page-size"]'); + const findTargetNamespaceDropdown = (rowWrapper) => + rowWrapper.find('[data-testid="target-namespace-selector"]'); const findPaginationDropdownText = () => findPaginationDropdown().find('button').text(); const findSelectionCount = () => wrapper.find('[data-test-id="selection-count"]'); @@ -137,6 +139,32 @@ describe('import table', () => { expect(wrapper.findAll('tbody tr')).toHaveLength(FAKE_GROUPS.length); }); + it('correctly maintains root namespace as last import target', async () => { + createComponent({ + bulkImportSourceGroups: () => ({ + nodes: [ + { + ...generateFakeEntry({ id: 1, status: STATUSES.FINISHED }), + lastImportTarget: { + id: 1, + targetNamespace: ROOT_NAMESPACE.fullPath, + newName: 'does-not-matter', + }, + }, + ], + pageInfo: FAKE_PAGE_INFO, + versionValidation: FAKE_VERSION_VALIDATION, + }), + }); + + await waitForPromises(); + const firstRow = wrapper.find('tbody tr'); + const targetNamespaceDropdownButton = findTargetNamespaceDropdown(firstRow).find( + '[aria-haspopup]', + ); + expect(targetNamespaceDropdownButton.text()).toBe('No parent'); + }); + it('does not render status string when result list is empty', async () => { createComponent({ bulkImportSourceGroups: jest.fn().mockResolvedValue({ |