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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 03:09:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 03:09:34 +0300
commit3cd08f4bf96cda3e9d3abf233095107832b17c20 (patch)
treedc09a618783a79d70f2a404374d4b850ccf9cc84 /spec/frontend
parentdd4bee69b7d55620f7dc9db8c36b478bd4959755 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/monitoring/embed/mock_data.js37
-rw-r--r--spec/frontend/monitoring/store/utils_spec.js8
2 files changed, 6 insertions, 39 deletions
diff --git a/spec/frontend/monitoring/embed/mock_data.js b/spec/frontend/monitoring/embed/mock_data.js
index 1dc31846034..da8eb8c0fc4 100644
--- a/spec/frontend/monitoring/embed/mock_data.js
+++ b/spec/frontend/monitoring/embed/mock_data.js
@@ -1,4 +1,4 @@
-export const metricsWithData = [15, 16];
+export const metricsWithData = ['15_metric_a', '16_metric_b'];
export const groups = [
{
@@ -7,41 +7,12 @@ export const groups = [
title: 'Memory Usage (Total)',
type: 'area-chart',
y_label: 'Total Memory Used',
- weight: 4,
- metrics: [
- {
- id: 'system_metrics_kubernetes_container_memory_total',
- metric_id: 15,
- },
- ],
- },
- {
- title: 'Core Usage (Total)',
- type: 'area-chart',
- y_label: 'Total Cores',
- weight: 3,
- metrics: [
- {
- id: 'system_metrics_kubernetes_container_cores_total',
- metric_id: 16,
- },
- ],
+ metrics: null,
},
],
},
];
-export const metrics = [
- {
- id: 'system_metrics_kubernetes_container_memory_total',
- metric_id: 15,
- },
- {
- id: 'system_metrics_kubernetes_container_cores_total',
- metric_id: 16,
- },
-];
-
const result = [
{
values: [
@@ -60,7 +31,7 @@ export const metricsData = [
{
metrics: [
{
- metric_id: 15,
+ metricId: '15_metric_a',
result,
},
],
@@ -68,7 +39,7 @@ export const metricsData = [
{
metrics: [
{
- metric_id: 16,
+ metricId: '16_metric_b',
result,
},
],
diff --git a/spec/frontend/monitoring/store/utils_spec.js b/spec/frontend/monitoring/store/utils_spec.js
index 2bd8af9b7d5..1e5bbc9c113 100644
--- a/spec/frontend/monitoring/store/utils_spec.js
+++ b/spec/frontend/monitoring/store/utils_spec.js
@@ -213,20 +213,16 @@ describe('mapToDashboardViewModel', () => {
expect(getMappedMetric(dashboard)).toEqual({
label: expect.any(String),
metricId: expect.any(String),
- metric_id: expect.any(String),
});
});
- it('creates a metric with a correct ids', () => {
+ it('creates a metric with a correct id', () => {
const dashboard = dashboardWithMetric({
id: 'http_responses',
metric_id: 1,
});
- expect(getMappedMetric(dashboard)).toMatchObject({
- metricId: '1_http_responses',
- metric_id: '1_http_responses',
- });
+ expect(getMappedMetric(dashboard).metricId).toEqual('1_http_responses');
});
it('creates a metric with a default label', () => {