From 8efd23015d3321824c12df1e3d3ed87674f8cd4d Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Wed, 22 Mar 2017 17:58:57 -0600 Subject: [PATCH] Fixed prometheus_graph_spec.js and scss-linters --- app/assets/stylesheets/pages/environments.scss | 6 ++++-- spec/javascripts/monitoring/prometheus_graph_spec.js | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/pages/environments.scss b/app/assets/stylesheets/pages/environments.scss index b55fa185406..6faa3794c83 100644 --- a/app/assets/stylesheets/pages/environments.scss +++ b/app/assets/stylesheets/pages/environments.scss @@ -159,19 +159,21 @@ text { fill: $stat-graph-axis-fill; } + .label-axis-text, .text-metric-usage { fill: $black; font-weight: 500; } - .legend-axis-text{ + + .legend-axis-text { fill: $black; } } .x-axis path, .y-axis path, -.x-axis-line, +.label-x-axis-line, .label-y-axis-line { fill: none; stroke-width: 1; diff --git a/spec/javascripts/monitoring/prometheus_graph_spec.js b/spec/javascripts/monitoring/prometheus_graph_spec.js index a3c1c5e1b7c..c2bcd9c0f7c 100644 --- a/spec/javascripts/monitoring/prometheus_graph_spec.js +++ b/spec/javascripts/monitoring/prometheus_graph_spec.js @@ -37,9 +37,11 @@ describe('PrometheusGraph', () => { it('transforms the data', () => { this.prometheusGraph.init(prometheusMockData.metrics); - expect(this.prometheusGraph.data).toBeDefined(); - expect(this.prometheusGraph.data.cpu_values.length).toBe(121); - expect(this.prometheusGraph.data.memory_values.length).toBe(121); + Object.keys(this.prometheusGraph.graphSpecificProperties, (key) => { + const graphProps = this.prometheusGraph.graphSpecificProperties[key]; + expect(graphProps.data).toBeDefined(); + expect(graphProps.data.length).toBe(121); + }); }); it('creates two graphs', () => { @@ -68,7 +70,7 @@ describe('PrometheusGraph', () => { expect($prometheusGraphContents.find('.label-y-axis-line')).toBeDefined(); expect($prometheusGraphContents.find('.label-axis-text')).toBeDefined(); expect($prometheusGraphContents.find('.rect-axis-text')).toBeDefined(); - expect($axisLabelContainer.find('rect').length).toBe(2); + expect($axisLabelContainer.find('rect').length).toBe(3); expect($axisLabelContainer.find('text').length).toBe(4); }); });