summaryrefslogtreecommitdiff
path: root/spec/javascripts/monitoring
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-17 18:07:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-17 18:07:48 +0000
commite72386771751fb22245bc6604fef236a2ee130cb (patch)
tree7cf54bca933159cb177d3caa2f139f87d6d30391 /spec/javascripts/monitoring
parentc2b98d3dbd47ab92c79c702276fe9130d9a28036 (diff)
downloadgitlab-ce-e72386771751fb22245bc6604fef236a2ee130cb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts/monitoring')
-rw-r--r--spec/javascripts/monitoring/charts/column_spec.js62
-rw-r--r--spec/javascripts/monitoring/charts/empty_chart_spec.js33
-rw-r--r--spec/javascripts/monitoring/charts/heatmap_spec.js69
-rw-r--r--spec/javascripts/monitoring/charts/single_stat_spec.js31
4 files changed, 0 insertions, 195 deletions
diff --git a/spec/javascripts/monitoring/charts/column_spec.js b/spec/javascripts/monitoring/charts/column_spec.js
deleted file mode 100644
index 9676617e8e1..00000000000
--- a/spec/javascripts/monitoring/charts/column_spec.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import { shallowMount, createLocalVue } from '@vue/test-utils';
-import { GlColumnChart } from '@gitlab/ui/dist/charts';
-import ColumnChart from '~/monitoring/components/charts/column.vue';
-
-const localVue = createLocalVue();
-
-describe('Column component', () => {
- let columnChart;
-
- beforeEach(() => {
- columnChart = shallowMount(localVue.extend(ColumnChart), {
- propsData: {
- graphData: {
- metrics: [
- {
- x_label: 'Time',
- y_label: 'Usage',
- result: [
- {
- metric: {},
- values: [
- [1495700554.925, '8.0390625'],
- [1495700614.925, '8.0390625'],
- [1495700674.925, '8.0390625'],
- ],
- },
- ],
- },
- ],
- },
- containerWidth: 100,
- },
- sync: false,
- localVue,
- });
- });
-
- afterEach(() => {
- columnChart.destroy();
- });
-
- describe('wrapped components', () => {
- describe('GitLab UI column chart', () => {
- let glColumnChart;
-
- beforeEach(() => {
- glColumnChart = columnChart.find(GlColumnChart);
- });
-
- it('is a Vue instance', () => {
- expect(glColumnChart.isVueInstance()).toBe(true);
- });
-
- it('receives data properties needed for proper chart render', () => {
- const props = glColumnChart.props();
-
- expect(props.data).toBe(columnChart.vm.chartData);
- expect(props.option).toBe(columnChart.vm.chartOptions);
- });
- });
- });
-});
diff --git a/spec/javascripts/monitoring/charts/empty_chart_spec.js b/spec/javascripts/monitoring/charts/empty_chart_spec.js
deleted file mode 100644
index 06822126b59..00000000000
--- a/spec/javascripts/monitoring/charts/empty_chart_spec.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import { shallowMount, createLocalVue } from '@vue/test-utils';
-import EmptyChart from '~/monitoring/components/charts/empty_chart.vue';
-
-const localVue = createLocalVue();
-
-describe('Empty Chart component', () => {
- let emptyChart;
- const graphTitle = 'Memory Usage';
-
- beforeEach(() => {
- emptyChart = shallowMount(localVue.extend(EmptyChart), {
- propsData: {
- graphTitle,
- },
- sync: false,
- localVue,
- });
- });
-
- 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');
- });
- });
-});
diff --git a/spec/javascripts/monitoring/charts/heatmap_spec.js b/spec/javascripts/monitoring/charts/heatmap_spec.js
deleted file mode 100644
index 9a98fc6fb05..00000000000
--- a/spec/javascripts/monitoring/charts/heatmap_spec.js
+++ /dev/null
@@ -1,69 +0,0 @@
-import { shallowMount } from '@vue/test-utils';
-import { GlHeatmap } from '@gitlab/ui/dist/charts';
-import Heatmap from '~/monitoring/components/charts/heatmap.vue';
-import { graphDataPrometheusQueryRangeMultiTrack } from '../mock_data';
-
-describe('Heatmap component', () => {
- let heatmapChart;
- let store;
-
- beforeEach(() => {
- heatmapChart = shallowMount(Heatmap, {
- propsData: {
- graphData: graphDataPrometheusQueryRangeMultiTrack,
- containerWidth: 100,
- },
- store,
- });
- });
-
- afterEach(() => {
- heatmapChart.destroy();
- });
-
- describe('wrapped components', () => {
- describe('GitLab UI heatmap chart', () => {
- let glHeatmapChart;
-
- beforeEach(() => {
- glHeatmapChart = heatmapChart.find(GlHeatmap);
- });
-
- it('is a Vue instance', () => {
- expect(glHeatmapChart.isVueInstance()).toBe(true);
- });
-
- it('should display a label on the x axis', () => {
- expect(heatmapChart.vm.xAxisName).toBe(graphDataPrometheusQueryRangeMultiTrack.x_label);
- });
-
- it('should display a label on the y axis', () => {
- expect(heatmapChart.vm.yAxisName).toBe(graphDataPrometheusQueryRangeMultiTrack.y_label);
- });
-
- // According to the echarts docs https://echarts.apache.org/en/option.html#series-heatmap.data
- // each row of the heatmap chart is represented by an array inside another parent array
- // e.g. [[0, 0, 10]], the format represents the column, the row and finally the value
- // corresponding to the cell
-
- it('should return chartData with a length of x by y, with a length of 3 per array', () => {
- const row = heatmapChart.vm.chartData[0];
-
- expect(row.length).toBe(3);
- expect(heatmapChart.vm.chartData.length).toBe(30);
- });
-
- it('returns a series of labels for the x axis', () => {
- const { xAxisLabels } = heatmapChart.vm;
-
- expect(xAxisLabels.length).toBe(5);
- });
-
- it('returns a series of labels for the y axis', () => {
- const { yAxisLabels } = heatmapChart.vm;
-
- expect(yAxisLabels.length).toBe(6);
- });
- });
- });
-});
diff --git a/spec/javascripts/monitoring/charts/single_stat_spec.js b/spec/javascripts/monitoring/charts/single_stat_spec.js
deleted file mode 100644
index 6adca0b0eed..00000000000
--- a/spec/javascripts/monitoring/charts/single_stat_spec.js
+++ /dev/null
@@ -1,31 +0,0 @@
-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');
- });
- });
- });
-});