Commit fff153c5 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch 'xanf-remove-wrapper-contains' into 'master'

Refactor deprecated contains method

See merge request gitlab-org/gitlab!40655
parents 3f273a99 34fb514a
...@@ -26,10 +26,10 @@ describe('MergeRequestAnalyticsApp', () => { ...@@ -26,10 +26,10 @@ describe('MergeRequestAnalyticsApp', () => {
}); });
it('displays the throughput chart component', () => { it('displays the throughput chart component', () => {
expect(wrapper.contains(ThroughputChart)).toBe(true); expect(wrapper.find(ThroughputChart).exists()).toBe(true);
}); });
it('displays the throughput table component', () => { it('displays the throughput table component', () => {
expect(wrapper.contains(ThroughputTable)).toBe(true); expect(wrapper.find(ThroughputTable).exists()).toBe(true);
}); });
}); });
...@@ -40,7 +40,7 @@ describe('ThroughputTable', () => { ...@@ -40,7 +40,7 @@ describe('ThroughputTable', () => {
}; };
const displaysComponent = (component, visible) => { const displaysComponent = (component, visible) => {
expect(wrapper.contains(component)).toBe(visible); expect(wrapper.find(component).exists()).toBe(visible);
}; };
const additionalData = data => { const additionalData = data => {
......
...@@ -125,7 +125,7 @@ describe('Approvals ProjectRules', () => { ...@@ -125,7 +125,7 @@ describe('Approvals ProjectRules', () => {
}); });
it('should not render the unconfigured-security-rules component', () => { it('should not render the unconfigured-security-rules component', () => {
expect(wrapper.contains(UnconfiguredSecurityRules)).toBe(false); expect(wrapper.find(UnconfiguredSecurityRules).exists()).toBe(false);
}); });
}); });
...@@ -153,7 +153,7 @@ describe('Approvals ProjectRules', () => { ...@@ -153,7 +153,7 @@ describe('Approvals ProjectRules', () => {
it(`should ${ it(`should ${
approvalSuggestions ? '' : 'not' approvalSuggestions ? '' : 'not'
} render the unconfigured-security-rules component`, () => { } render the unconfigured-security-rules component`, () => {
expect(wrapper.contains(UnconfiguredSecurityRules)).toBe(approvalSuggestions); expect(wrapper.find(UnconfiguredSecurityRules).exists()).toBe(approvalSuggestions);
}); });
}, },
); );
......
...@@ -74,7 +74,7 @@ describe('UnconfiguredSecurityRules component', () => { ...@@ -74,7 +74,7 @@ describe('UnconfiguredSecurityRules component', () => {
}); });
it(`should ${shouldRender ? '' : 'not'} render the loading skeleton`, () => { it(`should ${shouldRender ? '' : 'not'} render the loading skeleton`, () => {
expect(wrapper.contains(GlSkeletonLoading)).toBe(shouldRender); expect(wrapper.find(GlSkeletonLoading).exists()).toBe(shouldRender);
}); });
}, },
); );
......
...@@ -157,7 +157,7 @@ describe('Board List Header Component', () => { ...@@ -157,7 +157,7 @@ describe('Board List Header Component', () => {
it('when collapsed, it displays info icon', () => { it('when collapsed, it displays info icon', () => {
createComponent({ isSwimlanesHeader: true, collapsed: true }); createComponent({ isSwimlanesHeader: true, collapsed: true });
expect(wrapper.contains('.board-header-collapsed-info-icon')).toBe(true); expect(wrapper.find('.board-header-collapsed-info-icon').exists()).toBe(true);
}); });
}); });
}); });
......
...@@ -19,7 +19,7 @@ describe('AssigneesListItem', () => { ...@@ -19,7 +19,7 @@ describe('AssigneesListItem', () => {
}); });
it('renders component container element with class `filter-dropdown-item`', () => { it('renders component container element with class `filter-dropdown-item`', () => {
expect(wrapper.contains('.filter-dropdown-item')).toBe(true); expect(wrapper.find('.filter-dropdown-item').exists()).toBe(true);
}); });
it('emits `onItemSelect` event on component click and sends `assignee` as event param', () => { it('emits `onItemSelect` event on component click and sends `assignee` as event param', () => {
......
...@@ -62,7 +62,7 @@ describe('EpicsSwimlanes', () => { ...@@ -62,7 +62,7 @@ describe('EpicsSwimlanes', () => {
}); });
it('displays IssueLaneList component', () => { it('displays IssueLaneList component', () => {
expect(wrapper.contains(IssueLaneList)).toBe(true); expect(wrapper.find(IssueLaneList).exists()).toBe(true);
}); });
it('displays issues icon and count for unassigned issue', () => { it('displays issues icon and count for unassigned issue', () => {
......
...@@ -75,7 +75,7 @@ describe('DependenciesTable component', () => { ...@@ -75,7 +75,7 @@ describe('DependenciesTable component', () => {
}); });
it('renders the loading skeleton', () => { it('renders the loading skeleton', () => {
expect(wrapper.contains(GlSkeletonLoading)).toBe(true); expect(wrapper.find(GlSkeletonLoading).exists()).toBe(true);
}); });
it('does not render any dependencies', () => { it('does not render any dependencies', () => {
......
...@@ -270,7 +270,7 @@ describe('Feature flags', () => { ...@@ -270,7 +270,7 @@ describe('Feature flags', () => {
}); });
it('should display the user list table', () => { it('should display the user list table', () => {
expect(wrapper.contains(UserListsTable)).toBe(true); expect(wrapper.find(UserListsTable).exists()).toBe(true);
}); });
it('should set the user lists to display', () => { it('should set the user lists to display', () => {
......
...@@ -88,7 +88,7 @@ describe('New feature flag form', () => { ...@@ -88,7 +88,7 @@ describe('New feature flag form', () => {
}); });
it('should not alert users that feature flags are changing soon', () => { it('should not alert users that feature flags are changing soon', () => {
expect(wrapper.contains(GlAlert)).toBe(false); expect(wrapper.find(GlAlert).exists()).toBe(false);
}); });
it('should pass in the project ID', () => { it('should pass in the project ID', () => {
......
...@@ -31,8 +31,8 @@ describe('GeoSettingsApp', () => { ...@@ -31,8 +31,8 @@ describe('GeoSettingsApp', () => {
}); });
const findGeoSettingsContainer = () => wrapper.find('[data-testid="geoSettingsContainer"]'); const findGeoSettingsContainer = () => wrapper.find('[data-testid="geoSettingsContainer"]');
const containsGeoSettingsForm = () => wrapper.contains(GeoSettingsForm); const containsGeoSettingsForm = () => wrapper.find(GeoSettingsForm).exists();
const containsGlLoadingIcon = () => wrapper.contains(GlLoadingIcon); const containsGlLoadingIcon = () => wrapper.find(GlLoadingIcon).exists();
describe('renders', () => { describe('renders', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -35,7 +35,7 @@ describe('Insights chart component', () => { ...@@ -35,7 +35,7 @@ describe('Insights chart component', () => {
error: '', error: '',
}); });
expect(wrapper.contains(ChartSkeletonLoader)).toBe(true); expect(wrapper.find(ChartSkeletonLoader).exists()).toBe(true);
}); });
}); });
...@@ -49,7 +49,7 @@ describe('Insights chart component', () => { ...@@ -49,7 +49,7 @@ describe('Insights chart component', () => {
error: '', error: '',
}); });
expect(wrapper.contains(GlColumnChart)).toBe(true); expect(wrapper.find(GlColumnChart).exists()).toBe(true);
}); });
it('displays a line chart', () => { it('displays a line chart', () => {
...@@ -61,7 +61,7 @@ describe('Insights chart component', () => { ...@@ -61,7 +61,7 @@ describe('Insights chart component', () => {
error: '', error: '',
}); });
expect(wrapper.contains(GlLineChart)).toBe(true); expect(wrapper.find(GlLineChart).exists()).toBe(true);
}); });
it('displays a stacked bar chart', () => { it('displays a stacked bar chart', () => {
...@@ -73,7 +73,7 @@ describe('Insights chart component', () => { ...@@ -73,7 +73,7 @@ describe('Insights chart component', () => {
error: '', error: '',
}); });
expect(wrapper.contains(GlStackedColumnChart)).toBe(true); expect(wrapper.find(GlStackedColumnChart).exists()).toBe(true);
}); });
it('displays a bar chart when a pie chart is requested', () => { it('displays a bar chart when a pie chart is requested', () => {
...@@ -85,7 +85,7 @@ describe('Insights chart component', () => { ...@@ -85,7 +85,7 @@ describe('Insights chart component', () => {
error: '', error: '',
}); });
expect(wrapper.contains(GlColumnChart)).toBe(true); expect(wrapper.find(GlColumnChart).exists()).toBe(true);
}); });
}); });
...@@ -103,7 +103,7 @@ describe('Insights chart component', () => { ...@@ -103,7 +103,7 @@ describe('Insights chart component', () => {
}); });
it('displays info about the error', () => { it('displays info about the error', () => {
expect(wrapper.contains(InsightsChartError)).toBe(true); expect(wrapper.find(InsightsChartError).exists()).toBe(true);
}); });
}); });
}); });
...@@ -71,7 +71,7 @@ describe('Insights page component', () => { ...@@ -71,7 +71,7 @@ describe('Insights page component', () => {
}); });
it('shows an empty state', () => { it('shows an empty state', () => {
expect(wrapper.contains(GlEmptyState)).toBe(true); expect(wrapper.find(GlEmptyState).exists()).toBe(true);
}); });
}); });
...@@ -88,7 +88,7 @@ describe('Insights page component', () => { ...@@ -88,7 +88,7 @@ describe('Insights page component', () => {
}); });
it('does not show empty state', () => { it('does not show empty state', () => {
expect(wrapper.contains(GlEmptyState)).toBe(false); expect(wrapper.find(GlEmptyState).exists()).toBe(false);
}); });
describe('pageConfig changes', () => { describe('pageConfig changes', () => {
...@@ -97,7 +97,7 @@ describe('Insights page component', () => { ...@@ -97,7 +97,7 @@ describe('Insights page component', () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.contains(GlEmptyState)).toBe(true); expect(wrapper.find(GlEmptyState).exists()).toBe(true);
}); });
}); });
...@@ -113,7 +113,7 @@ describe('Insights page component', () => { ...@@ -113,7 +113,7 @@ describe('Insights page component', () => {
}); });
it('does not display chart', () => { it('does not display chart', () => {
expect(wrapper.contains(GlColumnChart)).toBe(false); expect(wrapper.find(GlColumnChart).exists()).toBe(false);
}); });
}); });
......
...@@ -60,8 +60,8 @@ describe('Insights component', () => { ...@@ -60,8 +60,8 @@ describe('Insights component', () => {
it('renders config loading state', async () => { it('renders config loading state', async () => {
vuexStore.state.insights.configLoading = true; vuexStore.state.insights.configLoading = true;
expect(wrapper.contains('.insights-config-loading')).toBe(true); expect(wrapper.find('.insights-config-loading').exists()).toBe(true);
expect(wrapper.contains('.insights-wrapper')).toBe(false); expect(wrapper.find('.insights-wrapper').exists()).toBe(false);
}); });
}); });
...@@ -86,7 +86,7 @@ describe('Insights component', () => { ...@@ -86,7 +86,7 @@ describe('Insights component', () => {
it('has the correct nav tabs', async () => { it('has the correct nav tabs', async () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.contains(GlDeprecatedDropdown)).toBe(true); expect(wrapper.find(GlDeprecatedDropdown).exists()).toBe(true);
expect( expect(
wrapper wrapper
.find(GlDeprecatedDropdown) .find(GlDeprecatedDropdown)
...@@ -117,7 +117,7 @@ describe('Insights component', () => { ...@@ -117,7 +117,7 @@ describe('Insights component', () => {
it('has the correct nav tabs', async () => { it('has the correct nav tabs', async () => {
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.contains(GlDeprecatedDropdown)).toBe(true); expect(wrapper.find(GlDeprecatedDropdown).exists()).toBe(true);
expect( expect(
wrapper wrapper
.find(GlDeprecatedDropdown) .find(GlDeprecatedDropdown)
......
...@@ -134,7 +134,7 @@ describe('Iterations report', () => { ...@@ -134,7 +134,7 @@ describe('Iterations report', () => {
}); });
it(`${canEditIteration ? 'is shown' : 'is hidden'}`, () => { it(`${canEditIteration ? 'is shown' : 'is hidden'}`, () => {
expect(wrapper.contains(GlNewDropdown)).toBe(canEditIteration); expect(wrapper.find(GlNewDropdown).exists()).toBe(canEditIteration);
}); });
}, },
); );
......
...@@ -41,8 +41,8 @@ describe('Iterations report tabs', () => { ...@@ -41,8 +41,8 @@ describe('Iterations report tabs', () => {
loading: true, loading: true,
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
expect(wrapper.contains(GlTable)).toBe(false); expect(wrapper.find(GlTable).exists()).toBe(false);
}); });
it('shows iterations list when not loading', () => { it('shows iterations list when not loading', () => {
...@@ -50,8 +50,8 @@ describe('Iterations report tabs', () => { ...@@ -50,8 +50,8 @@ describe('Iterations report tabs', () => {
loading: false, loading: false,
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
expect(wrapper.contains(GlTable)).toBe(true); expect(wrapper.find(GlTable).exists()).toBe(true);
expect(wrapper.text()).toContain('No issues found'); expect(wrapper.text()).toContain('No issues found');
}); });
...@@ -114,7 +114,7 @@ describe('Iterations report tabs', () => { ...@@ -114,7 +114,7 @@ describe('Iterations report tabs', () => {
}); });
it('shows issue list in table', () => { it('shows issue list in table', () => {
expect(wrapper.contains(GlTable)).toBe(true); expect(wrapper.find(GlTable).exists()).toBe(true);
expect(findIssues()).toHaveLength(issues.length); expect(findIssues()).toHaveLength(issues.length);
}); });
......
...@@ -19,13 +19,13 @@ describe('OnDemandScansApp', () => { ...@@ -19,13 +19,13 @@ describe('OnDemandScansApp', () => {
const findOnDemandScansForm = () => wrapper.find(OnDemandScansForm); const findOnDemandScansForm = () => wrapper.find(OnDemandScansForm);
const expectEmptyState = () => { const expectEmptyState = () => {
expect(wrapper.contains(OnDemandScansForm)).toBe(false); expect(wrapper.find(OnDemandScansForm).exists()).toBe(false);
expect(wrapper.contains(OnDemandScansEmptyState)).toBe(true); expect(wrapper.find(OnDemandScansEmptyState).exists()).toBe(true);
}; };
const expectForm = () => { const expectForm = () => {
expect(wrapper.contains(OnDemandScansForm)).toBe(true); expect(wrapper.find(OnDemandScansForm).exists()).toBe(true);
expect(wrapper.contains(OnDemandScansEmptyState)).toBe(false); expect(wrapper.find(OnDemandScansEmptyState).exists()).toBe(false);
}; };
const createComponent = options => { const createComponent = options => {
......
...@@ -196,7 +196,7 @@ describe('OnDemandScansApp', () => { ...@@ -196,7 +196,7 @@ describe('OnDemandScansApp', () => {
}); });
it('shows a skeleton loader', () => { it('shows a skeleton loader', () => {
expect(wrapper.contains(GlSkeletonLoader)).toBe(true); expect(wrapper.find(GlSkeletonLoader).exists()).toBe(true);
}); });
}); });
......
...@@ -47,7 +47,7 @@ describe('OnDemandScansEmptyState', () => { ...@@ -47,7 +47,7 @@ describe('OnDemandScansEmptyState', () => {
}); });
it('renders empty state', () => { it('renders empty state', () => {
expect(wrapper.contains(GlEmptyStateStub)).toBe(true); expect(wrapper.find(GlEmptyStateStub).exists()).toBe(true);
}); });
it('passes correct props to GlEmptyState', () => { it('passes correct props to GlEmptyState', () => {
......
...@@ -39,7 +39,7 @@ describe('project header component', () => { ...@@ -39,7 +39,7 @@ describe('project header component', () => {
describe('remove button', () => { describe('remove button', () => {
it('renders removal button icon', () => { it('renders removal button icon', () => {
expect(wrapper.contains('.js-remove-button')).toBe(true); expect(wrapper.find('.js-remove-button').exists()).toBe(true);
}); });
it('renders correct title for removal icon', () => { it('renders correct title for removal icon', () => {
......
...@@ -165,7 +165,7 @@ describe('RequirementForm', () => { ...@@ -165,7 +165,7 @@ describe('RequirementForm', () => {
describe('template', () => { describe('template', () => {
it('renders gl-drawer as component container element', () => { it('renders gl-drawer as component container element', () => {
expect(wrapper.contains(GlDrawer)).toBe(true); expect(wrapper.find(GlDrawer).exists()).toBe(true);
}); });
it('renders element containing requirement reference when form is in edit mode', () => { it('renders element containing requirement reference when form is in edit mode', () => {
......
...@@ -745,11 +745,11 @@ describe('RequirementsRoot', () => { ...@@ -745,11 +745,11 @@ describe('RequirementsRoot', () => {
}); });
it('renders requirements-tabs component', () => { it('renders requirements-tabs component', () => {
expect(wrapper.contains(RequirementsTabs)).toBe(true); expect(wrapper.find(RequirementsTabs).exists()).toBe(true);
}); });
it('renders filtered-search-bar component', () => { it('renders filtered-search-bar component', () => {
expect(wrapper.contains(FilteredSearchBarRoot)).toBe(true); expect(wrapper.find(FilteredSearchBarRoot).exists()).toBe(true);
expect(wrapper.find(FilteredSearchBarRoot).props('searchInputPlaceholder')).toBe( expect(wrapper.find(FilteredSearchBarRoot).props('searchInputPlaceholder')).toBe(
'Search requirements', 'Search requirements',
); );
...@@ -782,7 +782,7 @@ describe('RequirementsRoot', () => { ...@@ -782,7 +782,7 @@ describe('RequirementsRoot', () => {
}); });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.contains(RequirementsEmptyState)).toBe(true); expect(wrapper.find(RequirementsEmptyState).exists()).toBe(true);
}); });
}); });
...@@ -795,11 +795,11 @@ describe('RequirementsRoot', () => { ...@@ -795,11 +795,11 @@ describe('RequirementsRoot', () => {
}); });
it('renders requirement-create-form component', () => { it('renders requirement-create-form component', () => {
expect(wrapper.contains('requirement-create-form-stub')).toBe(true); expect(wrapper.find('requirement-create-form-stub').exists()).toBe(true);
}); });
it('renders requirement-edit-form component', () => { it('renders requirement-edit-form component', () => {
expect(wrapper.contains('requirement-edit-form-stub')).toBe(true); expect(wrapper.find('requirement-edit-form-stub').exists()).toBe(true);
}); });
it('does not render requirement-empty-state component when `showCreateForm` prop is `true`', () => { it('does not render requirement-empty-state component when `showCreateForm` prop is `true`', () => {
...@@ -808,7 +808,7 @@ describe('RequirementsRoot', () => { ...@@ -808,7 +808,7 @@ describe('RequirementsRoot', () => {
}); });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.contains(RequirementsEmptyState)).toBe(false); expect(wrapper.find(RequirementsEmptyState).exists()).toBe(false);
}); });
}); });
......
...@@ -87,15 +87,15 @@ describe('RoadmapApp', () => { ...@@ -87,15 +87,15 @@ describe('RoadmapApp', () => {
}); });
it(`loading icon is${showLoading ? '' : ' not'} shown`, () => { it(`loading icon is${showLoading ? '' : ' not'} shown`, () => {
expect(wrapper.contains(GlLoadingIcon)).toBe(showLoading); expect(wrapper.find(GlLoadingIcon).exists()).toBe(showLoading);
}); });
it(`roadmap is${showRoadmapShell ? '' : ' not'} shown`, () => { it(`roadmap is${showRoadmapShell ? '' : ' not'} shown`, () => {
expect(wrapper.contains(RoadmapShell)).toBe(showRoadmapShell); expect(wrapper.find(RoadmapShell).exists()).toBe(showRoadmapShell);
}); });
it(`empty state view is${showEpicsListEmpty ? '' : ' not'} shown`, () => { it(`empty state view is${showEpicsListEmpty ? '' : ' not'} shown`, () => {
expect(wrapper.contains(EpicsListEmpty)).toBe(showEpicsListEmpty); expect(wrapper.find(EpicsListEmpty).exists()).toBe(showEpicsListEmpty);
}); });
}, },
); );
...@@ -146,7 +146,7 @@ describe('RoadmapApp', () => { ...@@ -146,7 +146,7 @@ describe('RoadmapApp', () => {
}); });
it('contains roadmap filters UI', () => { it('contains roadmap filters UI', () => {
expect(wrapper.contains(RoadmapFilters)).toBe(true); expect(wrapper.find(RoadmapFilters).exists()).toBe(true);
}); });
it('contains the current group id', () => { it('contains the current group id', () => {
......
...@@ -49,7 +49,7 @@ describe('Filter component', () => { ...@@ -49,7 +49,7 @@ describe('Filter component', () => {
describe('buttons slot', () => { describe('buttons slot', () => {
it('should exist', () => { it('should exist', () => {
createWrapper(); createWrapper();
expect(wrapper.contains('.button-slot')).toBe(true); expect(wrapper.find('.button-slot').exists()).toBe(true);
}); });
}); });
}); });
...@@ -133,7 +133,7 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -133,7 +133,7 @@ describe('Pipeline Security Dashboard component', () => {
securityReportSummary, securityReportSummary,
}, },
}); });
expect(wrapper.contains(SecurityReportsSummary)).toBe(true); expect(wrapper.find(SecurityReportsSummary).exists()).toBe(true);
}); });
it('does not show the summary if it is empty', () => { it('does not show the summary if it is empty', () => {
...@@ -142,7 +142,7 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -142,7 +142,7 @@ describe('Pipeline Security Dashboard component', () => {
securityReportSummary: null, securityReportSummary: null,
}, },
}); });
expect(wrapper.contains(SecurityReportsSummary)).toBe(false); expect(wrapper.find(SecurityReportsSummary).exists()).toBe(false);
}); });
}); });
}); });
...@@ -124,7 +124,7 @@ describe('Security Dashboard component', () => { ...@@ -124,7 +124,7 @@ describe('Security Dashboard component', () => {
}); });
it('renders the issue modal', () => { it('renders the issue modal', () => {
expect(wrapper.contains(IssueModal)).toBe(true); expect(wrapper.find(IssueModal).exists()).toBe(true);
}); });
it('passes the "vulnerabilityFeedbackHelpPath" prop to the issue modal', () => { it('passes the "vulnerabilityFeedbackHelpPath" prop to the issue modal', () => {
......
...@@ -73,7 +73,7 @@ describe('SidebarStatus', () => { ...@@ -73,7 +73,7 @@ describe('SidebarStatus', () => {
beforeEach(() => {}); beforeEach(() => {});
it('renders Status component', () => { it('renders Status component', () => {
expect(wrapper.contains(Status)).toBe(true); expect(wrapper.find(Status).exists()).toBe(true);
}); });
it('calls handleFormSubmission when receiving an onDropdownClick event from Status component', () => { it('calls handleFormSubmission when receiving an onDropdownClick event from Status component', () => {
......
...@@ -61,7 +61,7 @@ describe('Status', () => { ...@@ -61,7 +61,7 @@ describe('Status', () => {
shallowMountStatus(props); shallowMountStatus(props);
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('is hidden when not retrieving data', () => { it('is hidden when not retrieving data', () => {
...@@ -71,7 +71,7 @@ describe('Status', () => { ...@@ -71,7 +71,7 @@ describe('Status', () => {
shallowMountStatus(props); shallowMountStatus(props);
expect(wrapper.contains(GlLoadingIcon)).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
}); });
}); });
......
...@@ -38,7 +38,7 @@ describe('Storage Counter project component', () => { ...@@ -38,7 +38,7 @@ describe('Storage Counter project component', () => {
}); });
it('renders project avatar', () => { it('renders project avatar', () => {
expect(wrapper.contains(ProjectAvatar)).toBe(true); expect(wrapper.find(ProjectAvatar).exists()).toBe(true);
}); });
it('renders project name', () => { it('renders project name', () => {
......
...@@ -21,7 +21,7 @@ describe('project pipeline component', () => { ...@@ -21,7 +21,7 @@ describe('project pipeline component', () => {
hasPipelineFailed: false, hasPipelineFailed: false,
}); });
expect(wrapper.contains('.js-ci-status-icon-success')).toBe(true); expect(wrapper.find('.js-ci-status-icon-success').exists()).toBe(true);
}); });
it('should render failed badge', () => { it('should render failed badge', () => {
...@@ -30,7 +30,7 @@ describe('project pipeline component', () => { ...@@ -30,7 +30,7 @@ describe('project pipeline component', () => {
hasPipelineFailed: true, hasPipelineFailed: true,
}); });
expect(wrapper.contains('.js-ci-status-icon-failed')).toBe(true); expect(wrapper.find('.js-ci-status-icon-failed').exists()).toBe(true);
}); });
it('should render running badge', () => { it('should render running badge', () => {
...@@ -39,7 +39,7 @@ describe('project pipeline component', () => { ...@@ -39,7 +39,7 @@ describe('project pipeline component', () => {
hasPipelineFailed: false, hasPipelineFailed: false,
}); });
expect(wrapper.contains('.js-ci-status-icon-running')).toBe(true); expect(wrapper.find('.js-ci-status-icon-running').exists()).toBe(true);
}); });
}); });
...@@ -52,7 +52,9 @@ describe('project pipeline component', () => { ...@@ -52,7 +52,9 @@ describe('project pipeline component', () => {
hasPipelineFailed: false, hasPipelineFailed: false,
}); });
expect(wrapper.contains('.js-upstream-pipeline-status.js-ci-status-icon-success')).toBe(true); expect(wrapper.find('.js-upstream-pipeline-status.js-ci-status-icon-success').exists()).toBe(
true,
);
}); });
}); });
...@@ -65,9 +67,9 @@ describe('project pipeline component', () => { ...@@ -65,9 +67,9 @@ describe('project pipeline component', () => {
hasPipelineFailed: false, hasPipelineFailed: false,
}); });
expect(wrapper.contains('.js-downstream-pipeline-status.js-ci-status-icon-success')).toBe( expect(
true, wrapper.find('.js-downstream-pipeline-status.js-ci-status-icon-success').exists(),
); ).toBe(true);
}); });
it('should render downstream failed badge', () => { it('should render downstream failed badge', () => {
...@@ -78,7 +80,7 @@ describe('project pipeline component', () => { ...@@ -78,7 +80,7 @@ describe('project pipeline component', () => {
hasPipelineFailed: false, hasPipelineFailed: false,
}); });
expect(wrapper.contains('.js-downstream-pipeline-status.js-ci-status-icon-failed')).toBe( expect(wrapper.find('.js-downstream-pipeline-status.js-ci-status-icon-failed').exists()).toBe(
true, true,
); );
}); });
...@@ -91,9 +93,9 @@ describe('project pipeline component', () => { ...@@ -91,9 +93,9 @@ describe('project pipeline component', () => {
hasPipelineFailed: false, hasPipelineFailed: false,
}); });
expect(wrapper.contains('.js-downstream-pipeline-status.js-ci-status-icon-running')).toBe( expect(
true, wrapper.find('.js-downstream-pipeline-status.js-ci-status-icon-running').exists(),
); ).toBe(true);
}); });
it('should render extra downstream icon', () => { it('should render extra downstream icon', () => {
...@@ -107,7 +109,7 @@ describe('project pipeline component', () => { ...@@ -107,7 +109,7 @@ describe('project pipeline component', () => {
hasPipelineFailed: false, hasPipelineFailed: false,
}); });
expect(wrapper.contains('.js-downstream-extra-icon')).toBe(true); expect(wrapper.find('.js-downstream-extra-icon').exists()).toBe(true);
}); });
}); });
}); });
...@@ -15,7 +15,7 @@ describe('time ago component', () => { ...@@ -15,7 +15,7 @@ describe('time ago component', () => {
describe('render', () => { describe('render', () => {
it('renders clock icon', () => { it('renders clock icon', () => {
expect(wrapper.contains('.js-dashboard-project-clock-icon')).toBe(true); expect(wrapper.find('.js-dashboard-project-clock-icon').exists()).toBe(true);
}); });
it('renders time ago of finished time', () => { it('renders time ago of finished time', () => {
......
...@@ -308,7 +308,7 @@ describe('License Report MR Widget', () => { ...@@ -308,7 +308,7 @@ describe('License Report MR Widget', () => {
const props = { ...defaultProps, fullReportPath: null }; const props = { ...defaultProps, fullReportPath: null };
mountComponent({ props }); mountComponent({ props });
expect(wrapper.contains(selector)).toBe(false); expect(wrapper.find(selector).exists()).toBe(false);
}); });
}); });
...@@ -329,7 +329,7 @@ describe('License Report MR Widget', () => { ...@@ -329,7 +329,7 @@ describe('License Report MR Widget', () => {
const props = { ...defaultProps, licenseManagementSettingsPath: null }; const props = { ...defaultProps, licenseManagementSettingsPath: null };
mountComponent({ props }); mountComponent({ props });
expect(wrapper.contains(selector)).toBe(false); expect(wrapper.find(selector).exists()).toBe(false);
}); });
}); });
......
...@@ -103,7 +103,7 @@ describe('Security Reports modal footer', () => { ...@@ -103,7 +103,7 @@ describe('Security Reports modal footer', () => {
}); });
it('renders create merge request and issue button as a split button', () => { it('renders create merge request and issue button as a split button', () => {
expect(wrapper.contains('.js-split-button')).toBe(true); expect(wrapper.find('.js-split-button').exists()).toBe(true);
expect(wrapper.vm.actionButtons).toHaveLength(2); expect(wrapper.vm.actionButtons).toHaveLength(2);
expect(wrapper.find(SplitButton).exists()).toBe(true); expect(wrapper.find(SplitButton).exists()).toBe(true);
expect(wrapper.find('.js-split-button').text()).toContain('Resolve with merge request'); expect(wrapper.find('.js-split-button').text()).toContain('Resolve with merge request');
......
...@@ -95,7 +95,7 @@ describe('Security Reports modal', () => { ...@@ -95,7 +95,7 @@ describe('Security Reports modal', () => {
}); });
it('renders create merge request and issue button as a split button', () => { it('renders create merge request and issue button as a split button', () => {
expect(wrapper.contains('.js-split-button')).toBe(true); expect(wrapper.find('.js-split-button').exists()).toBe(true);
expect(wrapper.find('.js-split-button').text()).toContain('Resolve with merge request'); expect(wrapper.find('.js-split-button').text()).toContain('Resolve with merge request');
expect(wrapper.find('.js-split-button').text()).toContain('Create issue'); expect(wrapper.find('.js-split-button').text()).toContain('Create issue');
}); });
...@@ -114,8 +114,8 @@ describe('Security Reports modal', () => { ...@@ -114,8 +114,8 @@ describe('Security Reports modal', () => {
Vue.nextTick() Vue.nextTick()
.then(() => { .then(() => {
expect(wrapper.contains('.js-split-button')).toBe(false); expect(wrapper.find('.js-split-button').exists()).toBe(false);
expect(wrapper.contains('.js-action-button')).toBe(true); expect(wrapper.find('.js-action-button').exists()).toBe(true);
expect(wrapper.find('.js-action-button').text()).not.toContain( expect(wrapper.find('.js-action-button').text()).not.toContain(
'Resolve with merge request', 'Resolve with merge request',
); );
...@@ -204,7 +204,7 @@ describe('Security Reports modal', () => { ...@@ -204,7 +204,7 @@ describe('Security Reports modal', () => {
}); });
it('displays a link to the issue', () => { it('displays a link to the issue', () => {
expect(wrapper.contains(IssueNote)).toBe(true); expect(wrapper.find(IssueNote).exists()).toBe(true);
}); });
}); });
...@@ -241,7 +241,7 @@ describe('Security Reports modal', () => { ...@@ -241,7 +241,7 @@ describe('Security Reports modal', () => {
}); });
it('displays a link to the merge request', () => { it('displays a link to the merge request', () => {
expect(wrapper.contains(MergeRequestNote)).toBe(true); expect(wrapper.find(MergeRequestNote).exists()).toBe(true);
}); });
}); });
...@@ -323,7 +323,7 @@ describe('Security Reports modal', () => { ...@@ -323,7 +323,7 @@ describe('Security Reports modal', () => {
expect(solutionCard.exists()).toBe(true); expect(solutionCard.exists()).toBe(true);
expect(solutionCard.text()).toContain(solution); expect(solutionCard.text()).toContain(solution);
expect(wrapper.contains('hr')).toBe(false); expect(wrapper.find('hr').exists()).toBe(false);
}); });
it('is rendered if the vulnerability has a remediation', () => { it('is rendered if the vulnerability has a remediation', () => {
...@@ -340,7 +340,7 @@ describe('Security Reports modal', () => { ...@@ -340,7 +340,7 @@ describe('Security Reports modal', () => {
expect(solutionCard.exists()).toBe(true); expect(solutionCard.exists()).toBe(true);
expect(solutionCard.text()).toContain(summary); expect(solutionCard.text()).toContain(summary);
expect(solutionCard.props('hasDownload')).toBe(true); expect(solutionCard.props('hasDownload')).toBe(true);
expect(wrapper.contains('hr')).toBe(false); expect(wrapper.find('hr').exists()).toBe(false);
}); });
it('is rendered if the vulnerability has neither a remediation nor a solution', () => { it('is rendered if the vulnerability has neither a remediation nor a solution', () => {
...@@ -352,7 +352,7 @@ describe('Security Reports modal', () => { ...@@ -352,7 +352,7 @@ describe('Security Reports modal', () => {
const solutionCard = wrapper.find(SolutionCard); const solutionCard = wrapper.find(SolutionCard);
expect(solutionCard.exists()).toBe(true); expect(solutionCard.exists()).toBe(true);
expect(wrapper.contains('hr')).toBe(false); expect(wrapper.find('hr').exists()).toBe(false);
}); });
}); });
......
...@@ -53,7 +53,7 @@ describe('Security Issue Body', () => { ...@@ -53,7 +53,7 @@ describe('Security Issue Body', () => {
}); });
} else { } else {
it(`does not show SeverityBadge if severity is not present`, () => { it(`does not show SeverityBadge if severity is not present`, () => {
expect(wrapper.contains(SeverityBadge)).toBe(false); expect(wrapper.find(SeverityBadge).exists()).toBe(false);
}); });
} }
......
...@@ -53,11 +53,11 @@ describe('Solution Card', () => { ...@@ -53,11 +53,11 @@ describe('Solution Card', () => {
}); });
it('does not render the card footer', () => { it('does not render the card footer', () => {
expect(wrapper.contains('.card-footer')).toBe(false); expect(wrapper.find('.card-footer').exists()).toBe(false);
}); });
it('does not render the download link', () => { it('does not render the download link', () => {
expect(wrapper.contains('a')).toBe(false); expect(wrapper.find('a').exists()).toBe(false);
}); });
}); });
...@@ -74,7 +74,7 @@ describe('Solution Card', () => { ...@@ -74,7 +74,7 @@ describe('Solution Card', () => {
}); });
it('renders the card footer', () => { it('renders the card footer', () => {
expect(wrapper.contains('.card-footer')).toBe(true); expect(wrapper.find('.card-footer').exists()).toBe(true);
}); });
describe('with download patch', () => { describe('with download patch', () => {
...@@ -92,7 +92,7 @@ describe('Solution Card', () => { ...@@ -92,7 +92,7 @@ describe('Solution Card', () => {
it('does not render the download and apply solution message when there is a file download and a merge request already exists', () => { it('does not render the download and apply solution message when there is a file download and a merge request already exists', () => {
wrapper.setProps({ hasMr: true }); wrapper.setProps({ hasMr: true });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.contains('.card-footer')).toBe(false); expect(wrapper.find('.card-footer').exists()).toBe(false);
}); });
}); });
......
...@@ -500,7 +500,7 @@ describe('Grouped security reports app', () => { ...@@ -500,7 +500,7 @@ describe('Grouped security reports app', () => {
return waitForMutation(wrapper.vm.$store, types.RECEIVE_DAST_DIFF_SUCCESS).then(() => { return waitForMutation(wrapper.vm.$store, types.RECEIVE_DAST_DIFF_SUCCESS).then(() => {
expect(wrapper.text()).not.toContain('0 URLs scanned'); expect(wrapper.text()).not.toContain('0 URLs scanned');
expect(wrapper.contains('[data-qa-selector="dast-ci-job-link"]')).toBe(false); expect(wrapper.find('[data-qa-selector="dast-ci-job-link"]').exists()).toBe(false);
}); });
}); });
}); });
...@@ -528,7 +528,7 @@ describe('Grouped security reports app', () => { ...@@ -528,7 +528,7 @@ describe('Grouped security reports app', () => {
}); });
it('should render the component', () => { it('should render the component', () => {
expect(wrapper.contains('[data-qa-selector="secret_scan_report"]')).toBe(true); expect(wrapper.find('[data-qa-selector="secret_scan_report"]').exists()).toBe(true);
}); });
it('should set setSecretScanningDiffEndpoint', () => { it('should set setSecretScanningDiffEndpoint', () => {
...@@ -548,7 +548,7 @@ describe('Grouped security reports app', () => { ...@@ -548,7 +548,7 @@ describe('Grouped security reports app', () => {
}); });
it('should not render the component', () => { it('should not render the component', () => {
expect(wrapper.contains('[data-qa-selector="secret_scan_report"]')).toBe(false); expect(wrapper.find('[data-qa-selector="secret_scan_report"]').exists()).toBe(false);
}); });
}); });
}); });
......
...@@ -78,13 +78,13 @@ describe('Vulnerability Footer', () => { ...@@ -78,13 +78,13 @@ describe('Vulnerability Footer', () => {
describe('solution card', () => { describe('solution card', () => {
it('does show solution card when there is one', () => { it('does show solution card when there is one', () => {
createWrapper({ ...minimumProps, solutionInfo: solutionInfoProp }); createWrapper({ ...minimumProps, solutionInfo: solutionInfoProp });
expect(wrapper.contains(SolutionCard)).toBe(true); expect(wrapper.find(SolutionCard).exists()).toBe(true);
expect(wrapper.find(SolutionCard).props()).toMatchObject(solutionInfoProp); expect(wrapper.find(SolutionCard).props()).toMatchObject(solutionInfoProp);
}); });
it('does not show solution card when there is not one', () => { it('does not show solution card when there is not one', () => {
createWrapper(); createWrapper();
expect(wrapper.contains(SolutionCard)).toBe(false); expect(wrapper.find(SolutionCard).exists()).toBe(false);
}); });
}); });
...@@ -98,7 +98,7 @@ describe('Vulnerability Footer', () => { ...@@ -98,7 +98,7 @@ describe('Vulnerability Footer', () => {
it('shows issue note when an issue exists for the vulnerability', () => { it('shows issue note when an issue exists for the vulnerability', () => {
createWrapper({ ...minimumProps, [prop]: feedback }); createWrapper({ ...minimumProps, [prop]: feedback });
expect(wrapper.contains(component)).toBe(true); expect(wrapper.find(component).exists()).toBe(true);
expect(wrapper.find(component).props()).toMatchObject({ expect(wrapper.find(component).props()).toMatchObject({
feedback, feedback,
}); });
...@@ -106,7 +106,7 @@ describe('Vulnerability Footer', () => { ...@@ -106,7 +106,7 @@ describe('Vulnerability Footer', () => {
it('does not show issue note when there is no issue for the vulnerability', () => { it('does not show issue note when there is no issue for the vulnerability', () => {
createWrapper(); createWrapper();
expect(wrapper.contains(component)).toBe(false); expect(wrapper.find(component).exists()).toBe(false);
}); });
}); });
......
...@@ -36,20 +36,20 @@ describe('Blob Content component', () => { ...@@ -36,20 +36,20 @@ describe('Blob Content component', () => {
describe('rendering', () => { describe('rendering', () => {
it('renders loader if `loading: true`', () => { it('renders loader if `loading: true`', () => {
createComponent({ loading: true }); createComponent({ loading: true });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
expect(wrapper.contains(BlobContentError)).toBe(false); expect(wrapper.find(BlobContentError).exists()).toBe(false);
expect(wrapper.contains(RichViewer)).toBe(false); expect(wrapper.find(RichViewer).exists()).toBe(false);
expect(wrapper.contains(SimpleViewer)).toBe(false); expect(wrapper.find(SimpleViewer).exists()).toBe(false);
}); });
it('renders error if there is any in the viewer', () => { it('renders error if there is any in the viewer', () => {
const renderError = 'Oops'; const renderError = 'Oops';
const viewer = { ...SimpleViewerMock, renderError }; const viewer = { ...SimpleViewerMock, renderError };
createComponent({}, viewer); createComponent({}, viewer);
expect(wrapper.contains(GlLoadingIcon)).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
expect(wrapper.contains(BlobContentError)).toBe(true); expect(wrapper.find(BlobContentError).exists()).toBe(true);
expect(wrapper.contains(RichViewer)).toBe(false); expect(wrapper.find(RichViewer).exists()).toBe(false);
expect(wrapper.contains(SimpleViewer)).toBe(false); expect(wrapper.find(SimpleViewer).exists()).toBe(false);
}); });
it.each` it.each`
...@@ -60,7 +60,7 @@ describe('Blob Content component', () => { ...@@ -60,7 +60,7 @@ describe('Blob Content component', () => {
'renders $type viewer when activeViewer is $type and no loading or error detected', 'renders $type viewer when activeViewer is $type and no loading or error detected',
({ mock, viewer }) => { ({ mock, viewer }) => {
createComponent({}, mock); createComponent({}, mock);
expect(wrapper.contains(viewer)).toBe(true); expect(wrapper.find(viewer).exists()).toBe(true);
}, },
); );
......
...@@ -58,7 +58,7 @@ describe('Blob Header Editing', () => { ...@@ -58,7 +58,7 @@ describe('Blob Header Editing', () => {
createComponent({ value: undefined }); createComponent({ value: undefined });
expect(spy).not.toHaveBeenCalled(); expect(spy).not.toHaveBeenCalled();
expect(wrapper.contains('#editor')).toBe(true); expect(wrapper.find('#editor').exists()).toBe(true);
}); });
it('initialises Editor Lite', () => { it('initialises Editor Lite', () => {
......
...@@ -31,7 +31,7 @@ describe('Blob Header Editing', () => { ...@@ -31,7 +31,7 @@ describe('Blob Header Editing', () => {
}); });
it('contains a form input field', () => { it('contains a form input field', () => {
expect(wrapper.contains(GlFormInput)).toBe(true); expect(wrapper.find(GlFormInput).exists()).toBe(true);
}); });
it('does not show delete button', () => { it('does not show delete button', () => {
......
...@@ -62,7 +62,7 @@ describe('BoardContent', () => { ...@@ -62,7 +62,7 @@ describe('BoardContent', () => {
}); });
it('does not display EpicsSwimlanes component', () => { it('does not display EpicsSwimlanes component', () => {
expect(wrapper.contains(EpicsSwimlanes)).toBe(false); expect(wrapper.find(EpicsSwimlanes).exists()).toBe(false);
expect(wrapper.contains(GlAlert)).toBe(false); expect(wrapper.find(GlAlert).exists()).toBe(false);
}); });
}); });
...@@ -49,7 +49,7 @@ describe('Ci variable modal', () => { ...@@ -49,7 +49,7 @@ describe('Ci variable modal', () => {
}); });
it('does not render the autocomplete dropdown', () => { it('does not render the autocomplete dropdown', () => {
expect(wrapper.contains(GlFormCombobox)).toBe(false); expect(wrapper.find(GlFormCombobox).exists()).toBe(false);
}); });
}); });
......
...@@ -300,11 +300,11 @@ describe('Application Row', () => { ...@@ -300,11 +300,11 @@ describe('Application Row', () => {
beforeEach(() => mountComponent({ updateAvailable: true })); beforeEach(() => mountComponent({ updateAvailable: true }));
it('the modal is not rendered', () => { it('the modal is not rendered', () => {
expect(wrapper.contains(UpdateApplicationConfirmationModal)).toBe(false); expect(wrapper.find(UpdateApplicationConfirmationModal).exists()).toBe(false);
}); });
it('the correct button is rendered', () => { it('the correct button is rendered', () => {
expect(wrapper.contains("[data-qa-selector='update_button']")).toBe(true); expect(wrapper.find("[data-qa-selector='update_button']").exists()).toBe(true);
}); });
}); });
...@@ -318,11 +318,13 @@ describe('Application Row', () => { ...@@ -318,11 +318,13 @@ describe('Application Row', () => {
}); });
it('displays a modal', () => { it('displays a modal', () => {
expect(wrapper.contains(UpdateApplicationConfirmationModal)).toBe(true); expect(wrapper.find(UpdateApplicationConfirmationModal).exists()).toBe(true);
}); });
it('the correct button is rendered', () => { it('the correct button is rendered', () => {
expect(wrapper.contains("[data-qa-selector='update_button_with_confirmation']")).toBe(true); expect(wrapper.find("[data-qa-selector='update_button_with_confirmation']").exists()).toBe(
true,
);
}); });
it('triggers updateApplication event', () => { it('triggers updateApplication event', () => {
...@@ -344,8 +346,10 @@ describe('Application Row', () => { ...@@ -344,8 +346,10 @@ describe('Application Row', () => {
version: '1.1.2', version: '1.1.2',
}); });
expect(wrapper.contains("[data-qa-selector='update_button_with_confirmation']")).toBe(true); expect(wrapper.find("[data-qa-selector='update_button_with_confirmation']").exists()).toBe(
expect(wrapper.contains(UpdateApplicationConfirmationModal)).toBe(true); true,
);
expect(wrapper.find(UpdateApplicationConfirmationModal).exists()).toBe(true);
}); });
it('does not need confirmation is version is 3.0.0', () => { it('does not need confirmation is version is 3.0.0', () => {
...@@ -355,8 +359,8 @@ describe('Application Row', () => { ...@@ -355,8 +359,8 @@ describe('Application Row', () => {
version: '3.0.0', version: '3.0.0',
}); });
expect(wrapper.contains("[data-qa-selector='update_button']")).toBe(true); expect(wrapper.find("[data-qa-selector='update_button']").exists()).toBe(true);
expect(wrapper.contains(UpdateApplicationConfirmationModal)).toBe(false); expect(wrapper.find(UpdateApplicationConfirmationModal).exists()).toBe(false);
}); });
it('does not need confirmation if version is higher than 3.0.0', () => { it('does not need confirmation if version is higher than 3.0.0', () => {
...@@ -366,8 +370,8 @@ describe('Application Row', () => { ...@@ -366,8 +370,8 @@ describe('Application Row', () => {
version: '5.2.1', version: '5.2.1',
}); });
expect(wrapper.contains("[data-qa-selector='update_button']")).toBe(true); expect(wrapper.find("[data-qa-selector='update_button']").exists()).toBe(true);
expect(wrapper.contains(UpdateApplicationConfirmationModal)).toBe(false); expect(wrapper.find(UpdateApplicationConfirmationModal).exists()).toBe(false);
}); });
}); });
}); });
......
...@@ -168,7 +168,7 @@ describe('FluentdOutputSettings', () => { ...@@ -168,7 +168,7 @@ describe('FluentdOutputSettings', () => {
}); });
it('displays a error message', () => { it('displays a error message', () => {
expect(wrapper.contains(GlAlert)).toBe(true); expect(wrapper.find(GlAlert).exists()).toBe(true);
}); });
}); });
}); });
......
...@@ -45,7 +45,7 @@ describe('ClustersAncestorNotice', () => { ...@@ -45,7 +45,7 @@ describe('ClustersAncestorNotice', () => {
}); });
it('displays link', () => { it('displays link', () => {
expect(wrapper.contains(GlLink)).toBe(true); expect(wrapper.find(GlLink).exists()).toBe(true);
}); });
}); });
}); });
...@@ -320,7 +320,7 @@ describe('diffs/components/app', () => { ...@@ -320,7 +320,7 @@ describe('diffs/components/app', () => {
state.diffs.isParallelView = false; state.diffs.isParallelView = false;
}); });
expect(wrapper.contains('.container-limited.limit-container-width')).toBe(true); expect(wrapper.find('.container-limited.limit-container-width').exists()).toBe(true);
}); });
it('does not add container-limiting classes when showFileTree is false with inline diffs', () => { it('does not add container-limiting classes when showFileTree is false with inline diffs', () => {
...@@ -329,7 +329,7 @@ describe('diffs/components/app', () => { ...@@ -329,7 +329,7 @@ describe('diffs/components/app', () => {
state.diffs.isParallelView = false; state.diffs.isParallelView = false;
}); });
expect(wrapper.contains('.container-limited.limit-container-width')).toBe(false); expect(wrapper.find('.container-limited.limit-container-width').exists()).toBe(false);
}); });
it('does not add container-limiting classes when isFluidLayout', () => { it('does not add container-limiting classes when isFluidLayout', () => {
...@@ -337,7 +337,7 @@ describe('diffs/components/app', () => { ...@@ -337,7 +337,7 @@ describe('diffs/components/app', () => {
state.diffs.isParallelView = false; state.diffs.isParallelView = false;
}); });
expect(wrapper.contains('.container-limited.limit-container-width')).toBe(false); expect(wrapper.find('.container-limited.limit-container-width').exists()).toBe(false);
}); });
it('displays loading icon on loading', () => { it('displays loading icon on loading', () => {
...@@ -345,7 +345,7 @@ describe('diffs/components/app', () => { ...@@ -345,7 +345,7 @@ describe('diffs/components/app', () => {
state.diffs.isLoading = true; state.diffs.isLoading = true;
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('displays loading icon on batch loading', () => { it('displays loading icon on batch loading', () => {
...@@ -353,20 +353,20 @@ describe('diffs/components/app', () => { ...@@ -353,20 +353,20 @@ describe('diffs/components/app', () => {
state.diffs.isBatchLoading = true; state.diffs.isBatchLoading = true;
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('displays diffs container when not loading', () => { it('displays diffs container when not loading', () => {
createComponent(); createComponent();
expect(wrapper.contains(GlLoadingIcon)).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
expect(wrapper.contains('#diffs')).toBe(true); expect(wrapper.find('#diffs').exists()).toBe(true);
}); });
it('does not show commit info', () => { it('does not show commit info', () => {
createComponent(); createComponent();
expect(wrapper.contains('.blob-commit-info')).toBe(false); expect(wrapper.find('.blob-commit-info').exists()).toBe(false);
}); });
describe('row highlighting', () => { describe('row highlighting', () => {
...@@ -442,7 +442,7 @@ describe('diffs/components/app', () => { ...@@ -442,7 +442,7 @@ describe('diffs/components/app', () => {
it('renders empty state when no diff files exist', () => { it('renders empty state when no diff files exist', () => {
createComponent(); createComponent();
expect(wrapper.contains(NoChanges)).toBe(true); expect(wrapper.find(NoChanges).exists()).toBe(true);
}); });
it('does not render empty state when diff files exist', () => { it('does not render empty state when diff files exist', () => {
...@@ -452,7 +452,7 @@ describe('diffs/components/app', () => { ...@@ -452,7 +452,7 @@ describe('diffs/components/app', () => {
}); });
}); });
expect(wrapper.contains(NoChanges)).toBe(false); expect(wrapper.find(NoChanges).exists()).toBe(false);
expect(wrapper.findAll(DiffFile).length).toBe(1); expect(wrapper.findAll(DiffFile).length).toBe(1);
}); });
...@@ -462,7 +462,7 @@ describe('diffs/components/app', () => { ...@@ -462,7 +462,7 @@ describe('diffs/components/app', () => {
state.diffs.mergeRequestDiff = mergeRequestDiff; state.diffs.mergeRequestDiff = mergeRequestDiff;
}); });
expect(wrapper.contains(NoChanges)).toBe(false); expect(wrapper.find(NoChanges).exists()).toBe(false);
}); });
}); });
...@@ -722,7 +722,7 @@ describe('diffs/components/app', () => { ...@@ -722,7 +722,7 @@ describe('diffs/components/app', () => {
state.diffs.mergeRequestDiff = mergeRequestDiff; state.diffs.mergeRequestDiff = mergeRequestDiff;
}); });
expect(wrapper.contains(CompareVersions)).toBe(true); expect(wrapper.find(CompareVersions).exists()).toBe(true);
expect(wrapper.find(CompareVersions).props()).toEqual( expect(wrapper.find(CompareVersions).props()).toEqual(
expect.objectContaining({ expect.objectContaining({
mergeRequestDiffs: diffsMockData, mergeRequestDiffs: diffsMockData,
...@@ -739,7 +739,7 @@ describe('diffs/components/app', () => { ...@@ -739,7 +739,7 @@ describe('diffs/components/app', () => {
state.diffs.size = 1; state.diffs.size = 1;
}); });
expect(wrapper.contains(HiddenFilesWarning)).toBe(true); expect(wrapper.find(HiddenFilesWarning).exists()).toBe(true);
expect(wrapper.find(HiddenFilesWarning).props()).toEqual( expect(wrapper.find(HiddenFilesWarning).props()).toEqual(
expect.objectContaining({ expect.objectContaining({
total: '5', total: '5',
...@@ -757,7 +757,7 @@ describe('diffs/components/app', () => { ...@@ -757,7 +757,7 @@ describe('diffs/components/app', () => {
}; };
}); });
expect(wrapper.contains(CommitWidget)).toBe(true); expect(wrapper.find(CommitWidget).exists()).toBe(true);
}); });
it('should display diff file if there are diff files', () => { it('should display diff file if there are diff files', () => {
...@@ -765,7 +765,7 @@ describe('diffs/components/app', () => { ...@@ -765,7 +765,7 @@ describe('diffs/components/app', () => {
state.diffs.diffFiles.push({ sha: '123' }); state.diffs.diffFiles.push({ sha: '123' });
}); });
expect(wrapper.contains(DiffFile)).toBe(true); expect(wrapper.find(DiffFile).exists()).toBe(true);
}); });
it('should render tree list', () => { it('should render tree list', () => {
......
...@@ -69,8 +69,8 @@ describe('FrequentItemsSearchInputComponent', () => { ...@@ -69,8 +69,8 @@ describe('FrequentItemsSearchInputComponent', () => {
describe('template', () => { describe('template', () => {
it('should render component element', () => { it('should render component element', () => {
expect(wrapper.classes()).toContain('search-input-container'); expect(wrapper.classes()).toContain('search-input-container');
expect(wrapper.contains('input.form-control')).toBe(true); expect(wrapper.find('input.form-control').exists()).toBe(true);
expect(wrapper.contains('.search-icon')).toBe(true); expect(wrapper.find('.search-icon').exists()).toBe(true);
expect(wrapper.find('input.form-control').attributes('placeholder')).toBe( expect(wrapper.find('input.form-control').attributes('placeholder')).toBe(
'Search your projects', 'Search your projects',
); );
......
...@@ -33,7 +33,7 @@ describe('BitbucketStatusTable', () => { ...@@ -33,7 +33,7 @@ describe('BitbucketStatusTable', () => {
it('renders import table component', () => { it('renders import table component', () => {
createComponent({ providerTitle: 'Test' }); createComponent({ providerTitle: 'Test' });
expect(wrapper.contains(ImportProjectsTable)).toBe(true); expect(wrapper.find(ImportProjectsTable).exists()).toBe(true);
}); });
it('passes alert in incompatible-repos-warning slot', () => { it('passes alert in incompatible-repos-warning slot', () => {
......
...@@ -77,13 +77,13 @@ describe('ImportProjectsTable', () => { ...@@ -77,13 +77,13 @@ describe('ImportProjectsTable', () => {
it('renders a loading icon while repos are loading', () => { it('renders a loading icon while repos are loading', () => {
createComponent({ state: { isLoadingRepos: true } }); createComponent({ state: { isLoadingRepos: true } });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('renders a loading icon while namespaces are loading', () => { it('renders a loading icon while namespaces are loading', () => {
createComponent({ state: { isLoadingNamespaces: true } }); createComponent({ state: { isLoadingNamespaces: true } });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('renders a table with provider repos', () => { it('renders a table with provider repos', () => {
...@@ -97,8 +97,8 @@ describe('ImportProjectsTable', () => { ...@@ -97,8 +97,8 @@ describe('ImportProjectsTable', () => {
state: { namespaces: [{ fullPath: 'path' }], repositories }, state: { namespaces: [{ fullPath: 'path' }], repositories },
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
expect(wrapper.contains('table')).toBe(true); expect(wrapper.find('table').exists()).toBe(true);
expect( expect(
wrapper wrapper
.findAll('th') .findAll('th')
...@@ -132,7 +132,7 @@ describe('ImportProjectsTable', () => { ...@@ -132,7 +132,7 @@ describe('ImportProjectsTable', () => {
it('renders an empty state if there are no projects available', () => { it('renders an empty state if there are no projects available', () => {
createComponent({ state: { repositories: [] } }); createComponent({ state: { repositories: [] } });
expect(wrapper.contains(ProviderRepoTableRow)).toBe(false); expect(wrapper.find(ProviderRepoTableRow).exists()).toBe(false);
expect(wrapper.text()).toContain(`No ${providerTitle} repositories found`); expect(wrapper.text()).toContain(`No ${providerTitle} repositories found`);
}); });
......
...@@ -82,7 +82,7 @@ describe('ProviderRepoTableRow', () => { ...@@ -82,7 +82,7 @@ describe('ProviderRepoTableRow', () => {
}); });
it('renders a select2 namespace select', () => { it('renders a select2 namespace select', () => {
expect(wrapper.contains(Select2Select)).toBe(true); expect(wrapper.find(Select2Select).exists()).toBe(true);
expect(wrapper.find(Select2Select).props().options.data).toBe(availableNamespaces); expect(wrapper.find(Select2Select).props().options.data).toBe(availableNamespaces);
}); });
...@@ -133,7 +133,7 @@ describe('ProviderRepoTableRow', () => { ...@@ -133,7 +133,7 @@ describe('ProviderRepoTableRow', () => {
}); });
it('does not renders a namespace select', () => { it('does not renders a namespace select', () => {
expect(wrapper.contains(Select2Select)).toBe(false); expect(wrapper.find(Select2Select).exists()).toBe(false);
}); });
it('does not render import button', () => { it('does not render import button', () => {
......
...@@ -57,7 +57,7 @@ describe('JiraIssuesFields', () => { ...@@ -57,7 +57,7 @@ describe('JiraIssuesFields', () => {
// As per https://vuejs.org/v2/guide/forms.html#Checkbox-1, // As per https://vuejs.org/v2/guide/forms.html#Checkbox-1,
// browsers don't include unchecked boxes in form submissions. // browsers don't include unchecked boxes in form submissions.
it('includes issues_enabled as false even if unchecked', () => { it('includes issues_enabled as false even if unchecked', () => {
expect(wrapper.contains('input[name="service[issues_enabled]"]')).toBe(true); expect(wrapper.find('input[name="service[issues_enabled]"]').exists()).toBe(true);
}); });
it('disables project_key input', () => { it('disables project_key input', () => {
...@@ -90,7 +90,7 @@ describe('JiraIssuesFields', () => { ...@@ -90,7 +90,7 @@ describe('JiraIssuesFields', () => {
it('contains link to editProjectPath', () => { it('contains link to editProjectPath', () => {
createComponent(); createComponent();
expect(wrapper.contains(`a[href="${defaultProps.editProjectPath}"]`)).toBe(true); expect(wrapper.find(`a[href="${defaultProps.editProjectPath}"]`).exists()).toBe(true);
}); });
}); });
}); });
...@@ -40,7 +40,7 @@ describe('RelatedIssuesBlock', () => { ...@@ -40,7 +40,7 @@ describe('RelatedIssuesBlock', () => {
}); });
it('add related issues form is hidden', () => { it('add related issues form is hidden', () => {
expect(wrapper.contains('.js-add-related-issues-form-area')).toBe(false); expect(wrapper.find('.js-add-related-issues-form-area').exists()).toBe(false);
}); });
}); });
...@@ -120,7 +120,7 @@ describe('RelatedIssuesBlock', () => { ...@@ -120,7 +120,7 @@ describe('RelatedIssuesBlock', () => {
}); });
it('shows add related issues form', () => { it('shows add related issues form', () => {
expect(wrapper.contains('.js-add-related-issues-form-area')).toBe(true); expect(wrapper.find('.js-add-related-issues-form-area').exists()).toBe(true);
}); });
}); });
......
...@@ -47,7 +47,7 @@ describe('IssuableListRootApp', () => { ...@@ -47,7 +47,7 @@ describe('IssuableListRootApp', () => {
it('does not show an alert', () => { it('does not show an alert', () => {
wrapper = mountComponent(); wrapper = mountComponent();
expect(wrapper.contains(GlAlert)).toBe(false); expect(wrapper.find(GlAlert).exists()).toBe(false);
}); });
}); });
...@@ -103,12 +103,12 @@ describe('IssuableListRootApp', () => { ...@@ -103,12 +103,12 @@ describe('IssuableListRootApp', () => {
shouldShowInProgressAlert: true, shouldShowInProgressAlert: true,
}); });
expect(wrapper.contains(GlAlert)).toBe(true); expect(wrapper.find(GlAlert).exists()).toBe(true);
findAlert().vm.$emit('dismiss'); findAlert().vm.$emit('dismiss');
return Vue.nextTick(() => { return Vue.nextTick(() => {
expect(wrapper.contains(GlAlert)).toBe(false); expect(wrapper.find(GlAlert).exists()).toBe(false);
}); });
}); });
}); });
......
...@@ -97,7 +97,7 @@ describe('Issuable component', () => { ...@@ -97,7 +97,7 @@ describe('Issuable component', () => {
const findUnscopedLabels = () => findLabels().filter(w => !isScopedLabel({ title: w.text() })); const findUnscopedLabels = () => findLabels().filter(w => !isScopedLabel({ title: w.text() }));
const findIssuableTitle = () => wrapper.find('[data-testid="issuable-title"]'); const findIssuableTitle = () => wrapper.find('[data-testid="issuable-title"]');
const findIssuableStatus = () => wrapper.find('[data-testid="issuable-status"]'); const findIssuableStatus = () => wrapper.find('[data-testid="issuable-status"]');
const containsJiraLogo = () => wrapper.contains('[data-testid="jira-logo"]'); const containsJiraLogo = () => wrapper.find('[data-testid="jira-logo"]').exists();
const findHealthStatus = () => wrapper.find('.health-status'); const findHealthStatus = () => wrapper.find('.health-status');
describe('when mounted', () => { describe('when mounted', () => {
......
...@@ -169,7 +169,7 @@ describe('Issuables list component', () => { ...@@ -169,7 +169,7 @@ describe('Issuables list component', () => {
it('does not display empty state', () => { it('does not display empty state', () => {
expect(wrapper.vm.issuables.length).toBeGreaterThan(0); expect(wrapper.vm.issuables.length).toBeGreaterThan(0);
expect(wrapper.vm.emptyState).toEqual({}); expect(wrapper.vm.emptyState).toEqual({});
expect(wrapper.contains(GlEmptyState)).toBe(false); expect(wrapper.find(GlEmptyState).exists()).toBe(false);
}); });
it('sets the proper page and total items', () => { it('sets the proper page and total items', () => {
......
...@@ -134,7 +134,7 @@ describe('Issuable output', () => { ...@@ -134,7 +134,7 @@ describe('Issuable output', () => {
wrapper.vm.showForm = true; wrapper.vm.showForm = true;
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.contains('.markdown-selector')).toBe(true); expect(wrapper.find('.markdown-selector').exists()).toBe(true);
}); });
}); });
...@@ -143,7 +143,7 @@ describe('Issuable output', () => { ...@@ -143,7 +143,7 @@ describe('Issuable output', () => {
wrapper.setProps({ canUpdate: false }); wrapper.setProps({ canUpdate: false });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.contains('.markdown-selector')).toBe(false); expect(wrapper.find('.markdown-selector').exists()).toBe(false);
}); });
}); });
...@@ -403,7 +403,7 @@ describe('Issuable output', () => { ...@@ -403,7 +403,7 @@ describe('Issuable output', () => {
.then(() => { .then(() => {
expect(wrapper.vm.formState.lockedWarningVisible).toEqual(true); expect(wrapper.vm.formState.lockedWarningVisible).toEqual(true);
expect(wrapper.vm.formState.lock_version).toEqual(1); expect(wrapper.vm.formState.lock_version).toEqual(1);
expect(wrapper.contains('.alert')).toBe(true); expect(wrapper.find('.alert').exists()).toBe(true);
}); });
}); });
}); });
...@@ -441,14 +441,14 @@ describe('Issuable output', () => { ...@@ -441,14 +441,14 @@ describe('Issuable output', () => {
describe('show inline edit button', () => { describe('show inline edit button', () => {
it('should not render by default', () => { it('should not render by default', () => {
expect(wrapper.contains('.btn-edit')).toBe(true); expect(wrapper.find('.btn-edit').exists()).toBe(true);
}); });
it('should render if showInlineEditButton', () => { it('should render if showInlineEditButton', () => {
wrapper.setProps({ showInlineEditButton: true }); wrapper.setProps({ showInlineEditButton: true });
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.contains('.btn-edit')).toBe(true); expect(wrapper.find('.btn-edit').exists()).toBe(true);
}); });
}); });
}); });
...@@ -531,7 +531,7 @@ describe('Issuable output', () => { ...@@ -531,7 +531,7 @@ describe('Issuable output', () => {
describe('sticky header', () => { describe('sticky header', () => {
describe('when title is in view', () => { describe('when title is in view', () => {
it('is not shown', () => { it('is not shown', () => {
expect(wrapper.contains('.issue-sticky-header')).toBe(false); expect(wrapper.find('.issue-sticky-header').exists()).toBe(false);
}); });
}); });
......
...@@ -100,7 +100,7 @@ describe('JiraImportForm', () => { ...@@ -100,7 +100,7 @@ describe('JiraImportForm', () => {
it('is shown', () => { it('is shown', () => {
wrapper = mountComponent(); wrapper = mountComponent();
expect(wrapper.contains(GlFormSelect)).toBe(true); expect(wrapper.find(GlFormSelect).exists()).toBe(true);
}); });
it('contains a list of Jira projects to select from', () => { it('contains a list of Jira projects to select from', () => {
......
...@@ -38,7 +38,7 @@ describe('Job Log Header Line', () => { ...@@ -38,7 +38,7 @@ describe('Job Log Header Line', () => {
}); });
it('renders the line number component', () => { it('renders the line number component', () => {
expect(wrapper.contains(LineNumber)).toBe(true); expect(wrapper.find(LineNumber).exists()).toBe(true);
}); });
it('renders a span the provided text', () => { it('renders a span the provided text', () => {
...@@ -90,7 +90,7 @@ describe('Job Log Header Line', () => { ...@@ -90,7 +90,7 @@ describe('Job Log Header Line', () => {
}); });
it('renders the duration badge', () => { it('renders the duration badge', () => {
expect(wrapper.contains(DurationBadge)).toBe(true); expect(wrapper.find(DurationBadge).exists()).toBe(true);
}); });
}); });
}); });
...@@ -35,7 +35,7 @@ describe('Job Log Line', () => { ...@@ -35,7 +35,7 @@ describe('Job Log Line', () => {
}); });
it('renders the line number component', () => { it('renders the line number component', () => {
expect(wrapper.contains(LineNumber)).toBe(true); expect(wrapper.find(LineNumber).exists()).toBe(true);
}); });
it('renders a span the provided text', () => { it('renders a span the provided text', () => {
......
...@@ -61,7 +61,7 @@ describe('MR Popover', () => { ...@@ -61,7 +61,7 @@ describe('MR Popover', () => {
}); });
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.contains(CiIcon)).toBe(false); expect(wrapper.find(CiIcon).exists()).toBe(false);
}); });
}); });
}); });
......
...@@ -38,16 +38,16 @@ describe('CustomizeHomepageBanner', () => { ...@@ -38,16 +38,16 @@ describe('CustomizeHomepageBanner', () => {
}); });
it('should render the banner when not dismissed', () => { it('should render the banner when not dismissed', () => {
expect(wrapper.contains(GlBanner)).toBe(true); expect(wrapper.find(GlBanner).exists()).toBe(true);
}); });
it('should close the banner when dismiss is clicked', async () => { it('should close the banner when dismiss is clicked', async () => {
mockAxios.onPost(provide.calloutsPath).replyOnce(200); mockAxios.onPost(provide.calloutsPath).replyOnce(200);
expect(wrapper.contains(GlBanner)).toBe(true); expect(wrapper.find(GlBanner).exists()).toBe(true);
wrapper.find(GlBanner).vm.$emit('close'); wrapper.find(GlBanner).vm.$emit('close');
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.contains(GlBanner)).toBe(false); expect(wrapper.find(GlBanner).exists()).toBe(false);
}); });
it('includes the body text from options', () => { it('includes the body text from options', () => {
......
...@@ -36,7 +36,7 @@ describe('BitbucketServerStatusTable', () => { ...@@ -36,7 +36,7 @@ describe('BitbucketServerStatusTable', () => {
it('renders bitbucket status table component', () => { it('renders bitbucket status table component', () => {
createComponent(); createComponent();
expect(wrapper.contains(BitbucketStatusTable)).toBe(true); expect(wrapper.find(BitbucketStatusTable).exists()).toBe(true);
}); });
it('renders Reconfigure button', async () => { it('renders Reconfigure button', async () => {
......
...@@ -70,7 +70,7 @@ describe('Fork groups list component', () => { ...@@ -70,7 +70,7 @@ describe('Fork groups list component', () => {
replyWith(() => new Promise(() => {})); replyWith(() => new Promise(() => {}));
createWrapper(); createWrapper();
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('displays empty text if no groups are available', async () => { it('displays empty text if no groups are available', async () => {
...@@ -89,7 +89,7 @@ describe('Fork groups list component', () => { ...@@ -89,7 +89,7 @@ describe('Fork groups list component', () => {
await waitForPromises(); await waitForPromises();
expect(wrapper.contains(GlSearchBoxByType)).toBe(true); expect(wrapper.find(GlSearchBoxByType).exists()).toBe(true);
}); });
it('renders list items for each available group', async () => { it('renders list items for each available group', async () => {
......
...@@ -36,7 +36,7 @@ describe('Pipelines Triggerer', () => { ...@@ -36,7 +36,7 @@ describe('Pipelines Triggerer', () => {
}); });
it('should render a table cell', () => { it('should render a table cell', () => {
expect(wrapper.contains('.table-section')).toBe(true); expect(wrapper.find('.table-section').exists()).toBe(true);
}); });
it('should pass triggerer information when triggerer is provided', () => { it('should pass triggerer information when triggerer is provided', () => {
......
...@@ -26,16 +26,16 @@ describe('ServiceDeskSetting', () => { ...@@ -26,16 +26,16 @@ describe('ServiceDeskSetting', () => {
}); });
it('should see activation checkbox', () => { it('should see activation checkbox', () => {
expect(wrapper.contains('#service-desk-checkbox')).toBe(true); expect(wrapper.find('#service-desk-checkbox').exists()).toBe(true);
}); });
it('should see main panel with the email info', () => { it('should see main panel with the email info', () => {
expect(wrapper.contains('#incoming-email-describer')).toBe(true); expect(wrapper.find('#incoming-email-describer').exists()).toBe(true);
}); });
it('should see loading spinner and not the incoming email', () => { it('should see loading spinner and not the incoming email', () => {
expect(wrapper.find(GlLoadingIcon).exists()).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
expect(wrapper.contains('.incoming-email')).toBe(false); expect(wrapper.find('.incoming-email').exists()).toBe(false);
}); });
}); });
}); });
...@@ -78,7 +78,7 @@ describe('ServiceDeskSetting', () => { ...@@ -78,7 +78,7 @@ describe('ServiceDeskSetting', () => {
}); });
it('renders a copy to clipboard button', () => { it('renders a copy to clipboard button', () => {
expect(wrapper.contains('.qa-clipboard-button')).toBe(true); expect(wrapper.find('.qa-clipboard-button').exists()).toBe(true);
expect(wrapper.find('.qa-clipboard-button').element.dataset.clipboardText).toBe( expect(wrapper.find('.qa-clipboard-button').element.dataset.clipboardText).toBe(
incomingEmail, incomingEmail,
); );
...@@ -93,7 +93,7 @@ describe('ServiceDeskSetting', () => { ...@@ -93,7 +93,7 @@ describe('ServiceDeskSetting', () => {
}, },
}); });
expect(wrapper.contains('#service-desk-template-select')).toBe(true); expect(wrapper.find('#service-desk-template-select').exists()).toBe(true);
}); });
it('renders a dropdown with a default value of ""', () => { it('renders a dropdown with a default value of ""', () => {
...@@ -202,15 +202,15 @@ describe('ServiceDeskSetting', () => { ...@@ -202,15 +202,15 @@ describe('ServiceDeskSetting', () => {
}); });
it('does not render email panel', () => { it('does not render email panel', () => {
expect(wrapper.contains('#incoming-email-describer')).toBe(false); expect(wrapper.find('#incoming-email-describer').exists()).toBe(false);
}); });
it('does not render template dropdown', () => { it('does not render template dropdown', () => {
expect(wrapper.contains('#service-desk-template-select')).toBe(false); expect(wrapper.find('#service-desk-template-select').exists()).toBe(false);
}); });
it('does not render template save button', () => { it('does not render template save button', () => {
expect(wrapper.contains('button.btn-success')).toBe(false); expect(wrapper.find('button.btn-success').exists()).toBe(false);
}); });
it('emits an event to turn on Service Desk when the toggle is clicked', () => { it('emits an event to turn on Service Desk when the toggle is clicked', () => {
......
...@@ -128,7 +128,7 @@ describe('Release block assets', () => { ...@@ -128,7 +128,7 @@ describe('Release block assets', () => {
describe('external vs internal links', () => { describe('external vs internal links', () => {
const containsExternalSourceIndicator = () => const containsExternalSourceIndicator = () =>
wrapper.contains('[data-testid="external-link-indicator"]'); wrapper.find('[data-testid="external-link-indicator"]').exists();
describe('when a link is external', () => { describe('when a link is external', () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -42,7 +42,7 @@ describe('Grouped Issues List', () => { ...@@ -42,7 +42,7 @@ describe('Grouped Issues List', () => {
}); });
it.each('resolved', 'unresolved')('does not render report items for %s issues', () => { it.each('resolved', 'unresolved')('does not render report items for %s issues', () => {
expect(wrapper.contains(ReportItem)).toBe(false); expect(wrapper.find(ReportItem).exists()).toBe(false);
}); });
}); });
......
...@@ -37,7 +37,7 @@ describe('Participants', () => { ...@@ -37,7 +37,7 @@ describe('Participants', () => {
loading: true, loading: true,
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('does not show loading spinner not loading', () => { it('does not show loading spinner not loading', () => {
...@@ -45,7 +45,7 @@ describe('Participants', () => { ...@@ -45,7 +45,7 @@ describe('Participants', () => {
loading: false, loading: false,
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(false); expect(wrapper.find(GlLoadingIcon).exists()).toBe(false);
}); });
it('shows participant count when given', () => { it('shows participant count when given', () => {
...@@ -74,7 +74,7 @@ describe('Participants', () => { ...@@ -74,7 +74,7 @@ describe('Participants', () => {
loading: true, loading: true,
}); });
expect(wrapper.contains(GlLoadingIcon)).toBe(true); expect(wrapper.find(GlLoadingIcon).exists()).toBe(true);
}); });
it('when only showing visible participants, shows an avatar only for each participant under the limit', () => { it('when only showing visible participants, shows an avatar only for each participant under the limit', () => {
...@@ -196,11 +196,11 @@ describe('Participants', () => { ...@@ -196,11 +196,11 @@ describe('Participants', () => {
}); });
it('does not show sidebar collapsed icon', () => { it('does not show sidebar collapsed icon', () => {
expect(wrapper.contains('.sidebar-collapsed-icon')).toBe(false); expect(wrapper.find('.sidebar-collapsed-icon').exists()).toBe(false);
}); });
it('does not show participants label title', () => { it('does not show participants label title', () => {
expect(wrapper.contains('.title')).toBe(false); expect(wrapper.find('.title').exists()).toBe(false);
}); });
}); });
}); });
...@@ -100,7 +100,7 @@ describe('Subscriptions', () => { ...@@ -100,7 +100,7 @@ describe('Subscriptions', () => {
}); });
it('does not render the toggle button', () => { it('does not render the toggle button', () => {
expect(wrapper.contains('.js-issuable-subscribe-button')).toBe(false); expect(wrapper.find('.js-issuable-subscribe-button').exists()).toBe(false);
}); });
}); });
}); });
...@@ -168,10 +168,10 @@ describe('Snippet Edit app', () => { ...@@ -168,10 +168,10 @@ describe('Snippet Edit app', () => {
props => { props => {
createComponent(props); createComponent(props);
expect(wrapper.contains(TitleField)).toBe(true); expect(wrapper.find(TitleField).exists()).toBe(true);
expect(wrapper.contains(SnippetDescriptionEdit)).toBe(true); expect(wrapper.find(SnippetDescriptionEdit).exists()).toBe(true);
expect(wrapper.contains(SnippetVisibilityEdit)).toBe(true); expect(wrapper.find(SnippetVisibilityEdit).exists()).toBe(true);
expect(wrapper.contains(FormFooterActions)).toBe(true); expect(wrapper.find(FormFooterActions).exists()).toBe(true);
expect(findBlobActions().exists()).toBe(true); expect(findBlobActions().exists()).toBe(true);
}, },
); );
......
...@@ -66,7 +66,7 @@ describe('Snippet view app', () => { ...@@ -66,7 +66,7 @@ describe('Snippet view app', () => {
}, },
}, },
}); });
expect(wrapper.contains(EmbedDropdown)).toBe(true); expect(wrapper.find(EmbedDropdown).exists()).toBe(true);
}); });
it('renders correct snippet-blob components', () => { it('renders correct snippet-blob components', () => {
...@@ -97,7 +97,7 @@ describe('Snippet view app', () => { ...@@ -97,7 +97,7 @@ describe('Snippet view app', () => {
}, },
}, },
}); });
expect(wrapper.contains(EmbedDropdown)).toBe(isRendered); expect(wrapper.find(EmbedDropdown).exists()).toBe(isRendered);
}); });
}); });
...@@ -119,7 +119,7 @@ describe('Snippet view app', () => { ...@@ -119,7 +119,7 @@ describe('Snippet view app', () => {
}, },
}, },
}); });
expect(wrapper.contains(CloneDropdownButton)).toBe(isRendered); expect(wrapper.find(CloneDropdownButton).exists()).toBe(isRendered);
}, },
); );
}); });
......
...@@ -21,7 +21,7 @@ describe('MrWidgetContainer', () => { ...@@ -21,7 +21,7 @@ describe('MrWidgetContainer', () => {
factory(); factory();
expect(wrapper.classes()).toContain('mr-widget-heading'); expect(wrapper.classes()).toContain('mr-widget-heading');
expect(wrapper.contains('.mr-widget-content')).toBe(true); expect(wrapper.find('.mr-widget-content').exists()).toBe(true);
}); });
it('accepts default slot', () => { it('accepts default slot', () => {
...@@ -31,7 +31,7 @@ describe('MrWidgetContainer', () => { ...@@ -31,7 +31,7 @@ describe('MrWidgetContainer', () => {
}, },
}); });
expect(wrapper.contains('.mr-widget-content .test-body')).toBe(true); expect(wrapper.find('.mr-widget-content .test-body').exists()).toBe(true);
}); });
it('accepts footer slot', () => { it('accepts footer slot', () => {
...@@ -42,7 +42,7 @@ describe('MrWidgetContainer', () => { ...@@ -42,7 +42,7 @@ describe('MrWidgetContainer', () => {
}, },
}); });
expect(wrapper.contains('.mr-widget-content .test-body')).toBe(true); expect(wrapper.find('.mr-widget-content .test-body').exists()).toBe(true);
expect(wrapper.contains('.test-footer')).toBe(true); expect(wrapper.find('.test-footer').exists()).toBe(true);
}); });
}); });
...@@ -18,7 +18,7 @@ describe('MrWidgetExpanableSection', () => { ...@@ -18,7 +18,7 @@ describe('MrWidgetExpanableSection', () => {
}); });
it('renders Icon', () => { it('renders Icon', () => {
expect(wrapper.contains(GlIcon)).toBe(true); expect(wrapper.find(GlIcon).exists()).toBe(true);
}); });
it('renders header slot', () => { it('renders header slot', () => {
......
...@@ -49,8 +49,8 @@ describe('MrWidgetTerraformConainer', () => { ...@@ -49,8 +49,8 @@ describe('MrWidgetTerraformConainer', () => {
}); });
it('diplays loading skeleton', () => { it('diplays loading skeleton', () => {
expect(wrapper.contains(GlSkeletonLoading)).toBe(true); expect(wrapper.find(GlSkeletonLoading).exists()).toBe(true);
expect(wrapper.contains(MrWidgetExpanableSection)).toBe(false); expect(wrapper.find(MrWidgetExpanableSection).exists()).toBe(false);
}); });
}); });
...@@ -61,8 +61,8 @@ describe('MrWidgetTerraformConainer', () => { ...@@ -61,8 +61,8 @@ describe('MrWidgetTerraformConainer', () => {
}); });
it('displays terraform content', () => { it('displays terraform content', () => {
expect(wrapper.contains(GlSkeletonLoading)).toBe(false); expect(wrapper.find(GlSkeletonLoading).exists()).toBe(false);
expect(wrapper.contains(MrWidgetExpanableSection)).toBe(true); expect(wrapper.find(MrWidgetExpanableSection).exists()).toBe(true);
expect(findPlans()).toEqual(Object.values(plans)); expect(findPlans()).toEqual(Object.values(plans));
}); });
...@@ -156,7 +156,7 @@ describe('MrWidgetTerraformConainer', () => { ...@@ -156,7 +156,7 @@ describe('MrWidgetTerraformConainer', () => {
}); });
it('stops loading', () => { it('stops loading', () => {
expect(wrapper.contains(GlSkeletonLoading)).toBe(false); expect(wrapper.find(GlSkeletonLoading).exists()).toBe(false);
}); });
it('generates one broken plan', () => { it('generates one broken plan', () => {
......
...@@ -36,6 +36,6 @@ describe('Blob Rich Viewer component', () => { ...@@ -36,6 +36,6 @@ describe('Blob Rich Viewer component', () => {
}); });
it('is using Markdown View Field', () => { it('is using Markdown View Field', () => {
expect(wrapper.contains(MarkdownFieldView)).toBe(true); expect(wrapper.find(MarkdownFieldView).exists()).toBe(true);
}); });
}); });
...@@ -118,7 +118,7 @@ describe('File row component', () => { ...@@ -118,7 +118,7 @@ describe('File row component', () => {
level: 0, level: 0,
}); });
expect(wrapper.contains(FileHeader)).toBe(true); expect(wrapper.find(FileHeader).exists()).toBe(true);
}); });
it('matches the current route against encoded file URL', () => { it('matches the current route against encoded file URL', () => {
......
...@@ -52,10 +52,10 @@ describe('FilteredSearchBarRoot', () => { ...@@ -52,10 +52,10 @@ describe('FilteredSearchBarRoot', () => {
expect(wrapper.vm.filterValue).toEqual([]); expect(wrapper.vm.filterValue).toEqual([]);
expect(wrapper.vm.selectedSortOption).toBe(mockSortOptions[0].sortDirection.descending); expect(wrapper.vm.selectedSortOption).toBe(mockSortOptions[0].sortDirection.descending);
expect(wrapper.vm.selectedSortDirection).toBe(SortDirection.descending); expect(wrapper.vm.selectedSortDirection).toBe(SortDirection.descending);
expect(wrapper.contains(GlButtonGroup)).toBe(true); expect(wrapper.find(GlButtonGroup).exists()).toBe(true);
expect(wrapper.contains(GlButton)).toBe(true); expect(wrapper.find(GlButton).exists()).toBe(true);
expect(wrapper.contains(GlDropdown)).toBe(true); expect(wrapper.find(GlDropdown).exists()).toBe(true);
expect(wrapper.contains(GlDropdownItem)).toBe(true); expect(wrapper.find(GlDropdownItem).exists()).toBe(true);
}); });
it('does not initialize `selectedSortOption` and `selectedSortDirection` when `sortOptions` is not applied and hides the sort dropdown', () => { it('does not initialize `selectedSortOption` and `selectedSortDirection` when `sortOptions` is not applied and hides the sort dropdown', () => {
......
...@@ -19,7 +19,7 @@ describe(`TimelineEntryItem`, () => { ...@@ -19,7 +19,7 @@ describe(`TimelineEntryItem`, () => {
expect(wrapper.classes()).toContain('timeline-entry'); expect(wrapper.classes()).toContain('timeline-entry');
expect(wrapper.contains('.timeline-entry-inner')).toBe(true); expect(wrapper.find('.timeline-entry-inner').exists()).toBe(true);
}); });
it('accepts default slot', () => { it('accepts default slot', () => {
......
...@@ -48,7 +48,7 @@ describe('Pagination links component', () => { ...@@ -48,7 +48,7 @@ describe('Pagination links component', () => {
describe('rendering', () => { describe('rendering', () => {
it('it renders the gl-paginated-list', () => { it('it renders the gl-paginated-list', () => {
expect(wrapper.contains('ul.list-group')).toBe(true); expect(wrapper.find('ul.list-group').exists()).toBe(true);
expect(wrapper.findAll('li.list-group-item').length).toBe(2); expect(wrapper.findAll('li.list-group-item').length).toBe(2);
}); });
}); });
......
...@@ -29,7 +29,7 @@ describe('ProjectListItem component', () => { ...@@ -29,7 +29,7 @@ describe('ProjectListItem component', () => {
it('does not render a check mark icon if selected === false', () => { it('does not render a check mark icon if selected === false', () => {
wrapper = shallowMount(Component, options); wrapper = shallowMount(Component, options);
expect(wrapper.contains('.js-selected-icon.js-unselected')).toBe(true); expect(wrapper.find('.js-selected-icon.js-unselected').exists()).toBe(true);
}); });
it('renders a check mark icon if selected === true', () => { it('renders a check mark icon if selected === true', () => {
...@@ -37,7 +37,7 @@ describe('ProjectListItem component', () => { ...@@ -37,7 +37,7 @@ describe('ProjectListItem component', () => {
wrapper = shallowMount(Component, options); wrapper = shallowMount(Component, options);
expect(wrapper.contains('.js-selected-icon.js-selected')).toBe(true); expect(wrapper.find('.js-selected-icon.js-selected').exists()).toBe(true);
}); });
it(`emits a "clicked" event when clicked`, () => { it(`emits a "clicked" event when clicked`, () => {
...@@ -53,7 +53,7 @@ describe('ProjectListItem component', () => { ...@@ -53,7 +53,7 @@ describe('ProjectListItem component', () => {
it(`renders the project avatar`, () => { it(`renders the project avatar`, () => {
wrapper = shallowMount(Component, options); wrapper = shallowMount(Component, options);
expect(wrapper.contains('.js-project-avatar')).toBe(true); expect(wrapper.find('.js-project-avatar').exists()).toBe(true);
}); });
it(`renders a simple namespace name with a trailing slash`, () => { it(`renders a simple namespace name with a trailing slash`, () => {
......
...@@ -48,7 +48,7 @@ describe('RemoveMemberModal', () => { ...@@ -48,7 +48,7 @@ describe('RemoveMemberModal', () => {
}); });
it(`${checkboxTestDescription}`, () => { it(`${checkboxTestDescription}`, () => {
expect(wrapper.contains(GlFormCheckbox)).toBe(checkboxExpected); expect(wrapper.find(GlFormCheckbox).exists()).toBe(checkboxExpected);
}); });
it('submits the form when the modal is submitted', () => { it('submits the form when the modal is submitted', () => {
......
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