Added test for the chart legend
This commit is contained in:
parent
9ec791eedb
commit
42d4b013ea
3 changed files with 7 additions and 1 deletions
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Fixed the chart legend not being set correctly
|
||||
merge_request: 12628
|
||||
author:
|
|
@ -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': {
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue