summaryrefslogtreecommitdiff
path: root/spec/frontend/projects/pipelines/charts/components/ci_cd_analytics_area_chart_spec.js
blob: 2b523467379354f29ddebb21edd689e213058456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { mount } from '@vue/test-utils';
import CiCdAnalyticsAreaChart from '~/vue_shared/components/ci_cd_analytics/ci_cd_analytics_area_chart.vue';
import { transformedAreaChartData } from '../mock_data';

describe('CiCdAnalyticsAreaChart', () => {
  let wrapper;

  beforeEach(() => {
    wrapper = mount(CiCdAnalyticsAreaChart, {
      propsData: {
        chartData: transformedAreaChartData,
        areaChartOptions: {
          xAxis: {
            name: 'X axis title',
            type: 'category',
          },
          yAxis: {
            name: 'Y axis title',
          },
        },
      },
      slots: {
        default: 'Some title',
      },
      stubs: {
        GlAreaChart: true,
      },
    });
  });

  afterEach(() => {
    wrapper.destroy();
    wrapper = null;
  });

  it('matches the snapshot', () => {
    expect(wrapper.element).toMatchSnapshot();
  });
});