diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 00:09:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 00:09:18 +0300 |
commit | ab5672c13d7fe5c79fdeac10e7505187cf4ba606 (patch) | |
tree | eb7036d6e4c8ce64c58f18185eced3a5e315c099 /spec/frontend/import_entities | |
parent | d23f33082ad893fad172b17f1ce66bd847671d56 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/import_entities')
-rw-r--r-- | spec/frontend/import_entities/components/import_status_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/spec/frontend/import_entities/components/import_status_spec.js b/spec/frontend/import_entities/components/import_status_spec.js index 8e569e3ec85..4c6fee35389 100644 --- a/spec/frontend/import_entities/components/import_status_spec.js +++ b/spec/frontend/import_entities/components/import_status_spec.js @@ -155,6 +155,7 @@ describe('Import entities status component', () => { describe('show details link', () => { const mockDetailsPath = 'details_path'; + const mockProjectId = 29; const mockCompleteStats = { fetched: { ...mockStatItems }, imported: { ...mockStatItems }, @@ -180,6 +181,7 @@ describe('Import entities status component', () => { beforeEach(() => { createComponent( { + projectId: mockProjectId, status: STATUSES.FINISHED, stats: partialImport ? mockIncompleteStats : mockCompleteStats, }, @@ -195,7 +197,9 @@ describe('Import entities status component', () => { it(`${expectLink ? 'renders' : 'does not render'} import details link`, () => { expect(findGlLink().exists()).toBe(expectLink); if (expectLink) { - expect(findGlLink().attributes('href')).toBe(mockDetailsPath); + expect(findGlLink().attributes('href')).toBe( + `${mockDetailsPath}?project_id=${mockProjectId}`, + ); } }); }, diff --git a/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js b/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js index 8e73f76382a..57e232a4c46 100644 --- a/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js +++ b/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js @@ -40,6 +40,7 @@ describe('ProviderRepoTableRow', () => { const findImportButton = () => findButton('Import'); const findReimportButton = () => findButton('Re-import'); const findGroupDropdown = () => wrapper.findComponent(ImportGroupDropdown); + const findImportStatus = () => wrapper.findComponent(ImportStatus); const findCancelButton = () => { const buttons = wrapper @@ -81,7 +82,7 @@ describe('ProviderRepoTableRow', () => { }); it('renders empty import status', () => { - expect(wrapper.findComponent(ImportStatus).props().status).toBe(STATUSES.NONE); + expect(findImportStatus().props().status).toBe(STATUSES.NONE); }); it('renders a group namespace select', () => { @@ -198,9 +199,7 @@ describe('ProviderRepoTableRow', () => { }); it('renders proper import status', () => { - expect(wrapper.findComponent(ImportStatus).props().status).toBe( - repo.importedProject.importStatus, - ); + expect(findImportStatus().props().status).toBe(repo.importedProject.importStatus); }); it('does not render a namespace select', () => { @@ -236,8 +235,11 @@ describe('ProviderRepoTableRow', () => { }); }); - it('passes stats to import status component', () => { - expect(wrapper.findComponent(ImportStatus).props().stats).toBe(FAKE_STATS); + it('passes props to import status component', () => { + expect(findImportStatus().props()).toMatchObject({ + projectId: repo.importedProject.id, + stats: FAKE_STATS, + }); }); }); |