Commit 1595388e authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'xanf-remove-isEmpty-false' into 'master'

Replace isEmpty() check with other expectations

See merge request gitlab-org/gitlab!40215
parents 493d94d6 8a8e6c9a
...@@ -110,8 +110,8 @@ describe('ImportProjectsTable', () => { ...@@ -110,8 +110,8 @@ describe('ImportProjectsTable', () => {
wrapper wrapper
.findAll('th') .findAll('th')
.filter(w => w.text() === `From ${providerTitle}`) .filter(w => w.text() === `From ${providerTitle}`)
.isEmpty(), .exists(),
).toBe(false); ).toBe(true);
expect(wrapper.contains(ProviderRepoTableRow)).toBe(true); expect(wrapper.contains(ProviderRepoTableRow)).toBe(true);
expect(wrapper.contains(ImportedProjectTableRow)).toBe(true); expect(wrapper.contains(ImportedProjectTableRow)).toBe(true);
......
...@@ -41,7 +41,7 @@ describe('Issuable suggestions app component', () => { ...@@ -41,7 +41,7 @@ describe('Issuable suggestions app component', () => {
wrapper.setData(data); wrapper.setData(data);
return wrapper.vm.$nextTick(() => { return wrapper.vm.$nextTick(() => {
expect(wrapper.isEmpty()).toBe(false); expect(wrapper.findAll('li').length).toBe(data.issues.length);
}); });
}); });
......
...@@ -122,7 +122,6 @@ describe('EnvironmentLogs', () => { ...@@ -122,7 +122,6 @@ describe('EnvironmentLogs', () => {
initWrapper(); initWrapper();
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isVueInstance()).toBe(true);
expect(wrapper.isEmpty()).toBe(false);
expect(findEnvironmentsDropdown().is(GlDeprecatedDropdown)).toBe(true); expect(findEnvironmentsDropdown().is(GlDeprecatedDropdown)).toBe(true);
expect(findSimpleFilters().exists()).toBe(true); expect(findSimpleFilters().exists()).toBe(true);
......
...@@ -69,7 +69,6 @@ describe('LogAdvancedFilters', () => { ...@@ -69,7 +69,6 @@ describe('LogAdvancedFilters', () => {
initWrapper(); initWrapper();
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isVueInstance()).toBe(true);
expect(wrapper.isEmpty()).toBe(false);
expect(findFilteredSearch().exists()).toBe(true); expect(findFilteredSearch().exists()).toBe(true);
expect(findTimeRangePicker().exists()).toBe(true); expect(findTimeRangePicker().exists()).toBe(true);
......
...@@ -29,7 +29,6 @@ describe('LogControlButtons', () => { ...@@ -29,7 +29,6 @@ describe('LogControlButtons', () => {
initWrapper(); initWrapper();
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isVueInstance()).toBe(true);
expect(wrapper.isEmpty()).toBe(false);
expect(findScrollToTop().is(GlButton)).toBe(true); expect(findScrollToTop().is(GlButton)).toBe(true);
expect(findScrollToBottom().is(GlButton)).toBe(true); expect(findScrollToBottom().is(GlButton)).toBe(true);
......
...@@ -60,7 +60,6 @@ describe('LogSimpleFilters', () => { ...@@ -60,7 +60,6 @@ describe('LogSimpleFilters', () => {
initWrapper(); initWrapper();
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isVueInstance()).toBe(true);
expect(wrapper.isEmpty()).toBe(false);
expect(findPodsDropdown().exists()).toBe(true); expect(findPodsDropdown().exists()).toBe(true);
}); });
......
...@@ -668,7 +668,11 @@ describe('Dashboard', () => { ...@@ -668,7 +668,11 @@ describe('Dashboard', () => {
}); });
it('shows a remove button, which removes a panel', () => { it('shows a remove button, which removes a panel', () => {
expect(findFirstDraggableRemoveButton().isEmpty()).toBe(false); expect(
findFirstDraggableRemoveButton()
.find('a')
.exists(),
).toBe(true);
expect(findDraggablePanels().length).toEqual(metricsDashboardPanelCount); expect(findDraggablePanels().length).toEqual(metricsDashboardPanelCount);
findFirstDraggableRemoveButton().trigger('click'); findFirstDraggableRemoveButton().trigger('click');
......
...@@ -48,7 +48,6 @@ describe('Pipelines filtered search', () => { ...@@ -48,7 +48,6 @@ describe('Pipelines filtered search', () => {
it('displays UI elements', () => { it('displays UI elements', () => {
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isVueInstance()).toBe(true);
expect(wrapper.isEmpty()).toBe(false);
expect(findFilteredSearch().exists()).toBe(true); expect(findFilteredSearch().exists()).toBe(true);
}); });
......
...@@ -50,7 +50,7 @@ describe('Pagination component', () => { ...@@ -50,7 +50,7 @@ describe('Pagination component', () => {
change: spy, change: spy,
}); });
expect(wrapper.isEmpty()).toBe(false); expect(wrapper.find(GlPagination).exists()).toBe(true);
}); });
it('renders if there is a prev page', () => { it('renders if there is a prev page', () => {
...@@ -66,7 +66,7 @@ describe('Pagination component', () => { ...@@ -66,7 +66,7 @@ describe('Pagination component', () => {
change: spy, change: spy,
}); });
expect(wrapper.isEmpty()).toBe(false); expect(wrapper.find(GlPagination).exists()).toBe(true);
}); });
}); });
......
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