diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-07-04 20:29:53 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-07-06 14:59:01 +0300 |
commit | 42d4b013eaf76735e3bb72b72b346dea364805ab (patch) | |
tree | ed3a25fac2b8ef6efbf9d964b7b04fc710a9ce38 /spec/javascripts | |
parent | 9ec791eedbad7afc35117ead7cc418c6524e75b7 (diff) |
Added test for the chart legend
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/monitoring/mock_data.js | 1 | ||||
-rw-r--r-- | spec/javascripts/monitoring/monitoring_column_spec.js | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/spec/javascripts/monitoring/mock_data.js b/spec/javascripts/monitoring/mock_data.js index 56d938e1fbe..b69f4eddffc 100644 --- a/spec/javascripts/monitoring/mock_data.js +++ b/spec/javascripts/monitoring/mock_data.js @@ -2481,6 +2481,7 @@ export const singleRowMetrics = [ 'queries': [ { 'query_range': 'avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m])) * 100', + 'label': 'Container CPU', 'result': [ { 'metric': { diff --git a/spec/javascripts/monitoring/monitoring_column_spec.js b/spec/javascripts/monitoring/monitoring_column_spec.js index b3bc97adc9f..c423024dce0 100644 --- a/spec/javascripts/monitoring/monitoring_column_spec.js +++ b/spec/javascripts/monitoring/monitoring_column_spec.js @@ -95,7 +95,7 @@ describe('MonitoringColumn', () => { }); }); - it('has a title for the y-axis that comes from the backend', () => { + it('has a title for the y-axis and the chart legend that comes from the backend', () => { const component = createComponent({ columnData: singleRowMetrics[0], classType: 'col-md-6', @@ -104,5 +104,6 @@ describe('MonitoringColumn', () => { }); expect(component.yAxisLabel).toEqual(component.columnData.y_label); + expect(component.legendTitle).toEqual(component.columnData.queries[0].label); }); }); |