Commit 42d4b013 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Added test for the chart legend

parent 9ec791ee
---
title: Fixed the chart legend not being set correctly
merge_request: 12628
author:
...@@ -2481,6 +2481,7 @@ export const singleRowMetrics = [ ...@@ -2481,6 +2481,7 @@ export const singleRowMetrics = [
'queries': [ 'queries': [
{ {
'query_range': 'avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m])) * 100', 'query_range': 'avg(rate(container_cpu_usage_seconds_total{%{environment_filter}}[2m])) * 100',
'label': 'Container CPU',
'result': [ 'result': [
{ {
'metric': { 'metric': {
......
...@@ -95,7 +95,7 @@ describe('MonitoringColumn', () => { ...@@ -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({ const component = createComponent({
columnData: singleRowMetrics[0], columnData: singleRowMetrics[0],
classType: 'col-md-6', classType: 'col-md-6',
...@@ -104,5 +104,6 @@ describe('MonitoringColumn', () => { ...@@ -104,5 +104,6 @@ describe('MonitoringColumn', () => {
}); });
expect(component.yAxisLabel).toEqual(component.columnData.y_label); expect(component.yAxisLabel).toEqual(component.columnData.y_label);
expect(component.legendTitle).toEqual(component.columnData.queries[0].label);
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment