gitlab-org--gitlab-foss/spec/javascripts/monitoring/charts/single_stat_spec.js
Jose Vargas e02cd451b2 Add single_stat chart component to the monitoring bundle
This merge requests just adds the component without integrating it
to the dashboard, it adds tests as well
2019-06-04 11:41:13 -05:00

28 lines
671 B
JavaScript

import { shallowMount } from '@vue/test-utils';
import SingleStatChart from '~/monitoring/components/charts/single_stat.vue';
describe('Single Stat Chart component', () => {
let singleStatChart;
beforeEach(() => {
singleStatChart = shallowMount(SingleStatChart, {
propsData: {
title: 'Time to render',
value: 1,
unit: 'sec',
},
});
});
afterEach(() => {
singleStatChart.destroy();
});
describe('computed', () => {
describe('valueWithUnit', () => {
it('should interpolate the value and unit props', () => {
expect(singleStatChart.vm.valueWithUnit).toBe('1sec');
});
});
});
});