Commit 7a67a29c authored by Phil Hughes's avatar Phil Hughes

Merge branch 'xanf-remove-is-vue-instance' into 'master'

Replace isVueInstance with alternate options

See merge request gitlab-org/gitlab!40218
parents f33410af 9b7b210b
...@@ -66,7 +66,7 @@ describe('OnDemandScansApp', () => { ...@@ -66,7 +66,7 @@ describe('OnDemandScansApp', () => {
it('renders properly', () => { it('renders properly', () => {
createComponent(); createComponent();
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.html()).not.toBe('');
}); });
describe('submit button', () => { describe('submit button', () => {
......
...@@ -82,7 +82,7 @@ describe('OnDemandScansApp', () => { ...@@ -82,7 +82,7 @@ describe('OnDemandScansApp', () => {
}); });
it('renders properly', () => { it('renders properly', () => {
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.html()).not.toBe('');
}); });
describe('computed props', () => { describe('computed props', () => {
......
...@@ -121,7 +121,7 @@ describe('EnvironmentLogs', () => { ...@@ -121,7 +121,7 @@ describe('EnvironmentLogs', () => {
it('displays UI elements', () => { it('displays UI elements', () => {
initWrapper(); initWrapper();
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);
......
...@@ -68,7 +68,7 @@ describe('LogAdvancedFilters', () => { ...@@ -68,7 +68,7 @@ describe('LogAdvancedFilters', () => {
it('displays UI elements', () => { it('displays UI elements', () => {
initWrapper(); initWrapper();
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);
......
...@@ -28,7 +28,7 @@ describe('LogControlButtons', () => { ...@@ -28,7 +28,7 @@ describe('LogControlButtons', () => {
it('displays UI elements', () => { it('displays UI elements', () => {
initWrapper(); initWrapper();
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);
......
...@@ -59,7 +59,7 @@ describe('LogSimpleFilters', () => { ...@@ -59,7 +59,7 @@ describe('LogSimpleFilters', () => {
it('displays UI elements', () => { it('displays UI elements', () => {
initWrapper(); initWrapper();
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isEmpty()).toBe(false);
expect(findPodsDropdown().exists()).toBe(true); expect(findPodsDropdown().exists()).toBe(true);
}); });
......
...@@ -46,9 +46,8 @@ describe('Anomaly chart component', () => { ...@@ -46,9 +46,8 @@ describe('Anomaly chart component', () => {
}); });
}); });
it('is a Vue instance', () => { it('renders correctly', () => {
expect(findTimeSeries().exists()).toBe(true); expect(findTimeSeries().exists()).toBe(true);
expect(findTimeSeries().isVueInstance()).toBe(true);
}); });
describe('receives props correctly', () => { describe('receives props correctly', () => {
......
...@@ -37,10 +37,6 @@ describe('Bar component', () => { ...@@ -37,10 +37,6 @@ describe('Bar component', () => {
chartData = barChart.vm.chartData[graphData.metrics[0].label]; chartData = barChart.vm.chartData[graphData.metrics[0].label];
}); });
it('is a Vue instance', () => {
expect(glbarChart.isVueInstance()).toBe(true);
});
it('should display a label on the x axis', () => { it('should display a label on the x axis', () => {
expect(glbarChart.props('xAxisTitle')).toBe(graphData.xLabel); expect(glbarChart.props('xAxisTitle')).toBe(graphData.xLabel);
}); });
......
...@@ -95,10 +95,6 @@ describe('Column component', () => { ...@@ -95,10 +95,6 @@ describe('Column component', () => {
describe('wrapped components', () => { describe('wrapped components', () => {
describe('GitLab UI column chart', () => { describe('GitLab UI column chart', () => {
it('is a Vue instance', () => {
expect(findChart().isVueInstance()).toBe(true);
});
it('receives data properties needed for proper chart render', () => { it('receives data properties needed for proper chart render', () => {
expect(chartProps('data').values).toEqual(dataValues); expect(chartProps('data').values).toEqual(dataValues);
}); });
......
...@@ -24,21 +24,14 @@ describe('Heatmap component', () => { ...@@ -24,21 +24,14 @@ describe('Heatmap component', () => {
}; };
describe('wrapped chart', () => { describe('wrapped chart', () => {
let glHeatmapChart;
beforeEach(() => { beforeEach(() => {
createWrapper(); createWrapper();
glHeatmapChart = findChart();
}); });
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
}); });
it('is a Vue instance', () => {
expect(glHeatmapChart.isVueInstance()).toBe(true);
});
it('should display a label on the x axis', () => { it('should display a label on the x axis', () => {
expect(wrapper.vm.xAxisName).toBe(graphData.xLabel); expect(wrapper.vm.xAxisName).toBe(graphData.xLabel);
}); });
......
...@@ -632,9 +632,8 @@ describe('Time series component', () => { ...@@ -632,9 +632,8 @@ describe('Time series component', () => {
return wrapper.vm.$nextTick(); return wrapper.vm.$nextTick();
}); });
it('is a Vue instance', () => { it('exists', () => {
expect(findChartComponent().exists()).toBe(true); expect(findChartComponent().exists()).toBe(true);
expect(findChartComponent().isVueInstance()).toBe(true);
}); });
it('receives data properties needed for proper chart render', () => { it('receives data properties needed for proper chart render', () => {
......
...@@ -141,7 +141,6 @@ describe('Dashboard Panel', () => { ...@@ -141,7 +141,6 @@ describe('Dashboard Panel', () => {
it('The Empty Chart component is rendered and is a Vue instance', () => { it('The Empty Chart component is rendered and is a Vue instance', () => {
expect(wrapper.find(MonitorEmptyChart).exists()).toBe(true); expect(wrapper.find(MonitorEmptyChart).exists()).toBe(true);
expect(wrapper.find(MonitorEmptyChart).isVueInstance()).toBe(true);
}); });
}); });
...@@ -170,7 +169,6 @@ describe('Dashboard Panel', () => { ...@@ -170,7 +169,6 @@ describe('Dashboard Panel', () => {
it('The Empty Chart component is rendered and is a Vue instance', () => { it('The Empty Chart component is rendered and is a Vue instance', () => {
expect(wrapper.find(MonitorEmptyChart).exists()).toBe(true); expect(wrapper.find(MonitorEmptyChart).exists()).toBe(true);
expect(wrapper.find(MonitorEmptyChart).isVueInstance()).toBe(true);
}); });
}); });
...@@ -226,13 +224,11 @@ describe('Dashboard Panel', () => { ...@@ -226,13 +224,11 @@ describe('Dashboard Panel', () => {
it('empty chart is rendered for empty results', () => { it('empty chart is rendered for empty results', () => {
createWrapper({ graphData: graphDataEmpty }); createWrapper({ graphData: graphDataEmpty });
expect(wrapper.find(MonitorEmptyChart).exists()).toBe(true); expect(wrapper.find(MonitorEmptyChart).exists()).toBe(true);
expect(wrapper.find(MonitorEmptyChart).isVueInstance()).toBe(true);
}); });
it('area chart is rendered by default', () => { it('area chart is rendered by default', () => {
createWrapper(); createWrapper();
expect(wrapper.find(MonitorTimeSeriesChart).exists()).toBe(true); expect(wrapper.find(MonitorTimeSeriesChart).exists()).toBe(true);
expect(wrapper.find(MonitorTimeSeriesChart).isVueInstance()).toBe(true);
}); });
describe.each` describe.each`
...@@ -254,7 +250,6 @@ describe('Dashboard Panel', () => { ...@@ -254,7 +250,6 @@ describe('Dashboard Panel', () => {
it(`renders the chart component and binds attributes`, () => { it(`renders the chart component and binds attributes`, () => {
expect(wrapper.find(component).exists()).toBe(true); expect(wrapper.find(component).exists()).toBe(true);
expect(wrapper.find(component).isVueInstance()).toBe(true);
expect(wrapper.find(component).attributes()).toMatchObject(attrs); expect(wrapper.find(component).attributes()).toMatchObject(attrs);
}); });
...@@ -548,7 +543,6 @@ describe('Dashboard Panel', () => { ...@@ -548,7 +543,6 @@ describe('Dashboard Panel', () => {
}); });
it('it renders a time series chart with no errors', () => { it('it renders a time series chart with no errors', () => {
expect(wrapper.find(MonitorTimeSeriesChart).isVueInstance()).toBe(true);
expect(wrapper.find(MonitorTimeSeriesChart).exists()).toBe(true); expect(wrapper.find(MonitorTimeSeriesChart).exists()).toBe(true);
}); });
}); });
......
...@@ -707,8 +707,7 @@ describe('Dashboard', () => { ...@@ -707,8 +707,7 @@ describe('Dashboard', () => {
}); });
it('renders correctly', () => { it('renders correctly', () => {
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.html()).not.toBe('');
expect(wrapper.exists()).toBe(true);
}); });
}); });
......
...@@ -47,7 +47,7 @@ describe('Pipelines filtered search', () => { ...@@ -47,7 +47,7 @@ describe('Pipelines filtered search', () => {
}); });
it('displays UI elements', () => { it('displays UI elements', () => {
expect(wrapper.isVueInstance()).toBe(true); expect(wrapper.isEmpty()).toBe(false);
expect(findFilteredSearch().exists()).toBe(true); expect(findFilteredSearch().exists()).toBe(true);
}); });
......
...@@ -38,10 +38,6 @@ describe('User Avatar Link Component', () => { ...@@ -38,10 +38,6 @@ describe('User Avatar Link Component', () => {
wrapper = null; wrapper = null;
}); });
it('should return a defined Vue component', () => {
expect(wrapper.isVueInstance()).toBe(true);
});
it('should have user-avatar-image registered as child component', () => { it('should have user-avatar-image registered as child component', () => {
expect(wrapper.vm.$options.components.userAvatarImage).toBeDefined(); expect(wrapper.vm.$options.components.userAvatarImage).toBeDefined();
}); });
......
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