summaryrefslogtreecommitdiff
path: root/spec/javascripts/monitoring/charts/single_stat_spec.js
blob: 127a4a7955ab4f400f6513b0d81bd00f61d3b95a (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
import { shallowMount } from '@vue/test-utils';
import SingleStatChart from '~/monitoring/components/charts/single_stat.vue';
import { graphDataPrometheusQuery } from '../mock_data';

describe('Single Stat Chart component', () => {
  let singleStatChart;

  beforeEach(() => {
    singleStatChart = shallowMount(SingleStatChart, {
      propsData: {
        graphData: graphDataPrometheusQuery,
      },
    });
  });

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

  describe('computed', () => {
    describe('engineeringNotation', () => {
      it('should interpolate the value and unit props', () => {
        expect(singleStatChart.vm.engineeringNotation).toBe('91MB');
      });
    });
  });
});