Commit 743c560d authored by Illya Klymov's avatar Illya Klymov

Replace usage of find/findAll in ee/spec/frontend/iterations

* migrate to proper use of findComponent/findAllComponents
parent 68755b38
......@@ -26,7 +26,7 @@ describe('Iteration Breadcrumb', () => {
const cadenceId = 1234;
const iterationId = 4567;
const findBreadcrumb = () => wrapper.find(GlBreadcrumb);
const findBreadcrumb = () => wrapper.findComponent(GlBreadcrumb);
const waitForApollo = async () => {
jest.runOnlyPendingTimers();
......@@ -101,7 +101,7 @@ describe('Iteration Breadcrumb', () => {
it('finds GlIcon', () => {
mountComponent(shallowMount);
expect(findBreadcrumb().find(GlIcon).exists()).toBe(true);
expect(findBreadcrumb().findComponent(GlIcon).exists()).toBe(true);
});
});
......
......@@ -264,7 +264,7 @@ describe('Iteration cadence list item', () => {
});
it('hides dropdown and delete button', () => {
expect(wrapper.find(GlDropdown).exists()).toBe(false);
expect(wrapper.findComponent(GlDropdown).exists()).toBe(false);
});
});
......@@ -278,7 +278,7 @@ describe('Iteration cadence list item', () => {
});
it('shows delete button', () => {
expect(wrapper.find(GlDropdown).exists()).toBe(true);
expect(wrapper.findComponent(GlDropdown).exists()).toBe(true);
});
it('opens confirmation modal to delete cadence', () => {
......@@ -288,7 +288,7 @@ describe('Iteration cadence list item', () => {
});
it('emits delete-cadence event with cadence ID', () => {
wrapper.find(GlModal).vm.$emit('ok');
wrapper.findComponent(GlModal).vm.$emit('ok');
expect(wrapper.emitted('delete-cadence')).toEqual([[cadence.id]]);
});
......@@ -298,13 +298,13 @@ describe('Iteration cadence list item', () => {
it('hides dropdown when canEditCadence is false', async () => {
await createComponent({ canEditCadence: false });
expect(wrapper.find(GlDropdown).exists()).toBe(false);
expect(wrapper.findComponent(GlDropdown).exists()).toBe(false);
});
it('shows dropdown when canEditCadence is true', async () => {
await createComponent({ canEditCadence: true });
expect(wrapper.find(GlDropdown).exists()).toBe(true);
expect(wrapper.findComponent(GlDropdown).exists()).toBe(true);
});
it.each([
......
......@@ -77,7 +77,7 @@ describe('Iteration Form', () => {
wrapper.destroy();
});
const findPageTitle = () => wrapper.find({ ref: 'pageTitle' });
const findPageTitle = () => wrapper.findComponent({ ref: 'pageTitle' });
const findTitle = () => wrapper.find('#iteration-title');
const findDescription = () => wrapper.find('#iteration-description');
const findStartDate = () => wrapper.find('#iteration-start-date');
......
......@@ -52,7 +52,7 @@ describe('Iteration Form', () => {
wrapper = null;
});
const findPageTitle = () => wrapper.find({ ref: 'pageTitle' });
const findPageTitle = () => wrapper.findComponent({ ref: 'pageTitle' });
const findTitle = () => wrapper.find('#iteration-title');
const findDescription = () => wrapper.find('#iteration-description');
const findStartDate = () => wrapper.find('#iteration-start-date');
......@@ -65,7 +65,7 @@ describe('Iteration Form', () => {
it('renders a form', () => {
createComponent();
expect(wrapper.find(GlForm).exists()).toBe(true);
expect(wrapper.findComponent(GlForm).exists()).toBe(true);
});
describe('New iteration', () => {
......
......@@ -35,9 +35,9 @@ describe('Iterations report', () => {
};
const labelsFetchPath = '/labels.json';
const findTopbar = () => wrapper.find({ ref: 'topbar' });
const findTitle = () => wrapper.find({ ref: 'title' });
const findDescription = () => wrapper.find({ ref: 'description' });
const findTopbar = () => wrapper.findComponent({ ref: 'topbar' });
const findTitle = () => wrapper.findComponent({ ref: 'title' });
const findDescription = () => wrapper.findComponent({ ref: 'description' });
const findActionsDropdown = () => wrapper.find('[data-testid="actions-dropdown"]');
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
......
......@@ -22,9 +22,9 @@ describe('Iterations report', () => {
labelsFetchPath: '/gitlab-org/gitlab-test/-/labels.json?include_ancestor_groups=true',
};
const findTopbar = () => wrapper.find({ ref: 'topbar' });
const findTitle = () => wrapper.find({ ref: 'title' });
const findDescription = () => wrapper.find({ ref: 'description' });
const findTopbar = () => wrapper.findComponent({ ref: 'topbar' });
const findTitle = () => wrapper.findComponent({ ref: 'title' });
const findDescription = () => wrapper.findComponent({ ref: 'description' });
const findActionsDropdown = () => wrapper.find('[data-testid="actions-dropdown"]');
const clickEditButton = () => {
findActionsDropdown().vm.$emit('click');
......
......@@ -6,7 +6,7 @@ import IterationsList from 'ee/iterations/components/iterations_list.vue';
describe('Iterations list', () => {
let wrapper;
const findGlLink = () => wrapper.find(GlLink);
const findGlLink = () => wrapper.findComponent(GlLink);
const mountComponent = (propsData = { iterations: [] }) => {
wrapper = shallowMount(IterationsList, {
......
......@@ -36,8 +36,8 @@ describe('Iterations', () => {
loading: true,
});
expect(wrapper.find(GlLoadingIcon).exists()).toBeTruthy();
expect(wrapper.find(IterationsList).exists()).toBeFalsy();
expect(wrapper.findComponent(GlLoadingIcon).exists()).toBeTruthy();
expect(wrapper.findComponent(IterationsList).exists()).toBeFalsy();
});
it('shows iterations list when not loading', () => {
......@@ -45,8 +45,8 @@ describe('Iterations', () => {
loading: false,
});
expect(wrapper.find(GlLoadingIcon).exists()).toBeFalsy();
expect(wrapper.find(IterationsList).exists()).toBeTruthy();
expect(wrapper.findComponent(GlLoadingIcon).exists()).toBeFalsy();
expect(wrapper.findComponent(IterationsList).exists()).toBeTruthy();
});
it('sets computed state from tabIndex', () => {
......@@ -64,7 +64,7 @@ describe('Iterations', () => {
});
describe('pagination', () => {
const findPagination = () => wrapper.find(GlPagination);
const findPagination = () => wrapper.findComponent(GlPagination);
const setPage = (page) => {
findPagination().vm.$emit('input', page);
return findPagination().vm.$nextTick();
......@@ -131,7 +131,7 @@ describe('Iterations', () => {
afterCursor: 'last-item',
});
wrapper.find(GlTabs).vm.$emit('activate-tab', 2);
wrapper.findComponent(GlTabs).vm.$emit('activate-tab', 2);
await wrapper.vm.$nextTick();
......@@ -195,7 +195,7 @@ describe('Iterations', () => {
});
it('tab shows error in alert', () => {
expect(wrapper.find(GlAlert).text()).toContain('Oh no!');
expect(wrapper.findComponent(GlAlert).text()).toContain('Oh no!');
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment