diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-10 00:09:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-10 00:09:12 +0300 |
commit | d183d2d76bcc25f983c0836805c712af096bcc2f (patch) | |
tree | 982987f91e1cf268dbad55e51c4ea57292abbbd6 /spec/frontend/import_entities | |
parent | 453634293e24164ffaa5cd708e47a1cebc07bcd3 (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 | 26 |
1 files changed, 23 insertions, 3 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 8d06c196d70..480f1bad8d4 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 @@ -7,7 +7,7 @@ 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 { HTTP_STATUS_BAD_REQUEST, HTTP_STATUS_OK } from '~/lib/utils/http_status'; +import { HTTP_STATUS_OK, HTTP_STATUS_TOO_MANY_REQUESTS } from '~/lib/utils/http_status'; import axios from '~/lib/utils/axios_utils'; import { STATUSES } from '~/import_entities/constants'; import { i18n, ROOT_NAMESPACE } from '~/import_entities/import_groups/constants'; @@ -270,8 +270,6 @@ describe('import table', () => { }, }); - axiosMock.onPost('/import/bulk_imports.json').reply(HTTP_STATUS_BAD_REQUEST); - await waitForPromises(); await findImportButtons()[0].trigger('click'); await waitForPromises(); @@ -283,6 +281,28 @@ describe('import table', () => { ); }); + it('displays inline error if importing group reports rate limit', async () => { + createComponent({ + bulkImportSourceGroups: () => ({ + nodes: [FAKE_GROUP], + pageInfo: FAKE_PAGE_INFO, + versionValidation: FAKE_VERSION_VALIDATION, + }), + importGroups: () => { + const error = new Error(); + error.response = { status: HTTP_STATUS_TOO_MANY_REQUESTS }; + throw error; + }, + }); + + await waitForPromises(); + await findImportButtons()[0].trigger('click'); + await waitForPromises(); + + expect(createAlert).not.toHaveBeenCalled(); + expect(wrapper.find('tbody tr').text()).toContain(i18n.ERROR_TOO_MANY_REQUESTS); + }); + describe('pagination', () => { const bulkImportSourceGroupsQueryMock = jest.fn().mockResolvedValue({ nodes: [FAKE_GROUP], |