2020-03-13 15:44:24 +05:30
|
|
|
import { mount } from '@vue/test-utils';
|
2021-03-08 18:12:59 +05:30
|
|
|
import CiCdAnalyticsAreaChart from '~/projects/pipelines/charts/components/ci_cd_analytics_area_chart.vue';
|
2020-03-13 15:44:24 +05:30
|
|
|
import { transformedAreaChartData } from '../mock_data';
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
describe('CiCdAnalyticsAreaChart', () => {
|
2020-03-13 15:44:24 +05:30
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2021-03-08 18:12:59 +05:30
|
|
|
wrapper = mount(CiCdAnalyticsAreaChart, {
|
2020-03-13 15:44:24 +05:30
|
|
|
propsData: {
|
|
|
|
chartData: transformedAreaChartData,
|
2021-03-08 18:12:59 +05:30
|
|
|
areaChartOptions: {
|
|
|
|
xAxis: {
|
|
|
|
name: 'X axis title',
|
|
|
|
type: 'category',
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
name: 'Y axis title',
|
|
|
|
},
|
|
|
|
},
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
slots: {
|
|
|
|
default: 'Some title',
|
|
|
|
},
|
|
|
|
stubs: {
|
|
|
|
GlAreaChart: true,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
wrapper = null;
|
|
|
|
});
|
|
|
|
|
|
|
|
it('matches the snapshot', () => {
|
|
|
|
expect(wrapper.element).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|