debian-mirror-gitlab/spec/javascripts/monitoring/charts/single_stat_spec.js

28 lines
713 B
JavaScript
Raw Normal View History

2019-09-04 21:01:54 +05:30
import { shallowMount } from '@vue/test-utils';
import SingleStatChart from '~/monitoring/components/charts/single_stat.vue';
2019-09-30 21:07:59 +05:30
import { graphDataPrometheusQuery } from '../mock_data';
2019-09-04 21:01:54 +05:30
describe('Single Stat Chart component', () => {
let singleStatChart;
beforeEach(() => {
singleStatChart = shallowMount(SingleStatChart, {
propsData: {
2019-09-30 21:07:59 +05:30
graphData: graphDataPrometheusQuery,
2019-09-04 21:01:54 +05:30
},
});
});
afterEach(() => {
singleStatChart.destroy();
});
describe('computed', () => {
2019-09-30 21:07:59 +05:30
describe('engineeringNotation', () => {
2019-09-04 21:01:54 +05:30
it('should interpolate the value and unit props', () => {
2019-09-30 21:07:59 +05:30
expect(singleStatChart.vm.engineeringNotation).toBe('91MB');
2019-09-04 21:01:54 +05:30
});
});
});
});