summaryrefslogtreecommitdiff
path: root/spec/javascripts/monitoring/charts/empty_chart_spec.js
blob: bbfca27dc5a196bbab9d414b6c901d5dd9fd92c0 (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
import { shallowMount } from '@vue/test-utils';
import EmptyChart from '~/monitoring/components/charts/empty_chart.vue';

describe('Empty Chart component', () => {
  let emptyChart;
  const graphTitle = 'Memory Usage';

  beforeEach(() => {
    emptyChart = shallowMount(EmptyChart, {
      propsData: {
        graphTitle,
      },
    });
  });

  afterEach(() => {
    emptyChart.destroy();
  });

  it('render the chart title', () => {
    expect(emptyChart.find({ ref: 'graphTitle' }).text()).toBe(graphTitle);
  });

  describe('Computed props', () => {
    it('sets the height for the svg container', () => {
      expect(emptyChart.vm.svgContainerStyle.height).toBe('300px');
    });
  });
});