diff options
Diffstat (limited to 'spec/frontend/import_entities/import_projects/components')
3 files changed, 24 insertions, 20 deletions
diff --git a/spec/frontend/import_entities/import_projects/components/bitbucket_status_table_spec.js b/spec/frontend/import_entities/import_projects/components/bitbucket_status_table_spec.js index ea88c361f7b..9eae4ed974e 100644 --- a/spec/frontend/import_entities/import_projects/components/bitbucket_status_table_spec.js +++ b/spec/frontend/import_entities/import_projects/components/bitbucket_status_table_spec.js @@ -33,12 +33,12 @@ describe('BitbucketStatusTable', () => { it('renders import table component', () => { createComponent({ providerTitle: 'Test' }); - expect(wrapper.find(ImportProjectsTable).exists()).toBe(true); + expect(wrapper.findComponent(ImportProjectsTable).exists()).toBe(true); }); it('passes alert in incompatible-repos-warning slot', () => { createComponent({ providerTitle: 'Test' }, ImportProjectsTableStub); - expect(wrapper.find(GlAlert).exists()).toBe(true); + expect(wrapper.findComponent(GlAlert).exists()).toBe(true); }); it('passes actions slot to import project table component', () => { @@ -46,14 +46,14 @@ describe('BitbucketStatusTable', () => { createComponent({ providerTitle: 'Test' }, ImportProjectsTableStub, { actions: actionsSlotContent, }); - expect(wrapper.find(ImportProjectsTable).text()).toBe(actionsSlotContent); + expect(wrapper.findComponent(ImportProjectsTable).text()).toBe(actionsSlotContent); }); it('dismisses alert when requested', async () => { createComponent({ providerTitle: 'Test' }, ImportProjectsTableStub); - wrapper.find(GlAlert).vm.$emit('dismiss'); + wrapper.findComponent(GlAlert).vm.$emit('dismiss'); await nextTick(); - expect(wrapper.find(GlAlert).exists()).toBe(false); + expect(wrapper.findComponent(GlAlert).exists()).toBe(false); }); }); diff --git a/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js b/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js index 140fec3863b..c0ae4294e3d 100644 --- a/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js +++ b/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js @@ -30,10 +30,10 @@ describe('ImportProjectsTable', () => { const findImportAllButton = () => wrapper - .findAll(GlButton) + .findAllComponents(GlButton) .filter((w) => w.props().variant === 'confirm') .at(0); - const findImportAllModal = () => wrapper.find({ ref: 'importAllModal' }); + const findImportAllModal = () => wrapper.findComponent({ ref: 'importAllModal' }); const importAllFn = jest.fn(); const importAllModalShowFn = jest.fn(); @@ -89,13 +89,13 @@ describe('ImportProjectsTable', () => { it('renders a loading icon while repos are loading', () => { createComponent({ state: { isLoadingRepos: true } }); - expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); }); it('renders a loading icon while namespaces are loading', () => { createComponent({ state: { isLoadingNamespaces: true } }); - expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); }); it('renders a table with provider repos', () => { @@ -109,7 +109,7 @@ describe('ImportProjectsTable', () => { state: { namespaces: [{ fullPath: 'path' }], repositories }, }); - expect(wrapper.find(GlLoadingIcon).exists()).toBe(false); + expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(false); expect(wrapper.find('table').exists()).toBe(true); expect( wrapper @@ -118,7 +118,7 @@ describe('ImportProjectsTable', () => { .exists(), ).toBe(true); - expect(wrapper.findAll(ProviderRepoTableRow)).toHaveLength(repositories.length); + expect(wrapper.findAllComponents(ProviderRepoTableRow)).toHaveLength(repositories.length); }); it.each` @@ -170,7 +170,7 @@ describe('ImportProjectsTable', () => { it('renders an empty state if there are no repositories available', () => { createComponent({ state: { repositories: [] } }); - expect(wrapper.find(ProviderRepoTableRow).exists()).toBe(false); + expect(wrapper.findComponent(ProviderRepoTableRow).exists()).toBe(false); expect(wrapper.text()).toContain(`No ${providerTitle} repositories found`); }); @@ -231,11 +231,11 @@ describe('ImportProjectsTable', () => { }); it('renders intersection observer component', () => { - expect(wrapper.find(GlIntersectionObserver).exists()).toBe(true); + expect(wrapper.findComponent(GlIntersectionObserver).exists()).toBe(true); }); it('calls fetchRepos when intersection observer appears', async () => { - wrapper.find(GlIntersectionObserver).vm.$emit('appear'); + wrapper.findComponent(GlIntersectionObserver).vm.$emit('appear'); await nextTick(); 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 41a005199e1..17a07b1e9f9 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 @@ -74,11 +74,13 @@ describe('ProviderRepoTableRow', () => { }); it('renders empty import status', () => { - expect(wrapper.find(ImportStatus).props().status).toBe(STATUSES.NONE); + expect(wrapper.findComponent(ImportStatus).props().status).toBe(STATUSES.NONE); }); it('renders a group namespace select', () => { - expect(wrapper.find(ImportGroupDropdown).props().namespaces).toBe(availableNamespaces); + expect(wrapper.findComponent(ImportGroupDropdown).props().namespaces).toBe( + availableNamespaces, + ); }); it('renders import button', () => { @@ -127,11 +129,13 @@ describe('ProviderRepoTableRow', () => { }); it('renders proper import status', () => { - expect(wrapper.find(ImportStatus).props().status).toBe(repo.importedProject.importStatus); + expect(wrapper.findComponent(ImportStatus).props().status).toBe( + repo.importedProject.importStatus, + ); }); it('does not renders a namespace select', () => { - expect(wrapper.find(GlDropdown).exists()).toBe(false); + expect(wrapper.findComponent(GlDropdown).exists()).toBe(false); }); it('does not render import button', () => { @@ -139,7 +143,7 @@ describe('ProviderRepoTableRow', () => { }); it('passes stats to import status component', () => { - expect(wrapper.find(ImportStatus).props().stats).toBe(FAKE_STATS); + expect(wrapper.findComponent(ImportStatus).props().stats).toBe(FAKE_STATS); }); }); @@ -165,7 +169,7 @@ describe('ProviderRepoTableRow', () => { }); it('renders badge with error', () => { - expect(wrapper.find(GlBadge).text()).toBe('Incompatible project'); + expect(wrapper.findComponent(GlBadge).text()).toBe('Incompatible project'); }); }); }); |