Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/monitoring/components/charts/single_stat_spec.js')
-rw-r--r--spec/frontend/monitoring/components/charts/single_stat_spec.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/frontend/monitoring/components/charts/single_stat_spec.js b/spec/frontend/monitoring/components/charts/single_stat_spec.js
new file mode 100644
index 00000000000..78bcc400787
--- /dev/null
+++ b/spec/frontend/monitoring/components/charts/single_stat_spec.js
@@ -0,0 +1,31 @@
+import { shallowMount, createLocalVue } from '@vue/test-utils';
+import SingleStatChart from '~/monitoring/components/charts/single_stat.vue';
+import { graphDataPrometheusQuery } from '../../mock_data';
+
+const localVue = createLocalVue();
+
+describe('Single Stat Chart component', () => {
+ let singleStatChart;
+
+ beforeEach(() => {
+ singleStatChart = shallowMount(localVue.extend(SingleStatChart), {
+ propsData: {
+ graphData: graphDataPrometheusQuery,
+ },
+ sync: false,
+ localVue,
+ });
+ });
+
+ afterEach(() => {
+ singleStatChart.destroy();
+ });
+
+ describe('computed', () => {
+ describe('engineeringNotation', () => {
+ it('should interpolate the value and unit props', () => {
+ expect(singleStatChart.vm.engineeringNotation).toBe('91MB');
+ });
+ });
+ });
+});