diff options
Diffstat (limited to 'spec/frontend/monitoring/mock_data.js')
-rw-r--r-- | spec/frontend/monitoring/mock_data.js | 146 |
1 files changed, 92 insertions, 54 deletions
diff --git a/spec/frontend/monitoring/mock_data.js b/spec/frontend/monitoring/mock_data.js index 0f443838985..6a0a3eeb5ae 100644 --- a/spec/frontend/monitoring/mock_data.js +++ b/spec/frontend/monitoring/mock_data.js @@ -717,6 +717,17 @@ const templatingVariableTypes = { }, }, }, + metricLabelValues: { + simple: { + label: 'Metric Label Values', + type: 'metric_label_values', + options: { + prometheus_endpoint_path: '/series', + series_selector: 'backend:haproxy_backend_availability:ratio{env="{{env}}"}', + label: 'backend', + }, + }, + }, }; const generateMockTemplatingData = data => { @@ -754,23 +765,25 @@ const responseForSimpleCustomVariable = { simpleCustom: { label: 'simpleCustom', value: 'value1', - options: [ - { - default: false, - text: 'value1', - value: 'value1', - }, - { - default: false, - text: 'value2', - value: 'value2', - }, - { - default: false, - text: 'value3', - value: 'value3', - }, - ], + options: { + values: [ + { + default: false, + text: 'value1', + value: 'value1', + }, + { + default: false, + text: 'value2', + value: 'value2', + }, + { + default: false, + text: 'value3', + value: 'value3', + }, + ], + }, type: 'custom', }, }; @@ -778,7 +791,9 @@ const responseForSimpleCustomVariable = { const responseForAdvancedCustomVariableWithoutOptions = { advCustomWithoutOpts: { label: 'advCustomWithoutOpts', - options: [], + options: { + values: [], + }, type: 'custom', }, }; @@ -787,18 +802,20 @@ const responseForAdvancedCustomVariableWithoutLabel = { advCustomWithoutLabel: { label: 'advCustomWithoutLabel', value: 'value2', - options: [ - { - default: false, - text: 'Var 1 Option 1', - value: 'value1', - }, - { - default: true, - text: 'Var 1 Option 2', - value: 'value2', - }, - ], + options: { + values: [ + { + default: false, + text: 'Var 1 Option 1', + value: 'value1', + }, + { + default: true, + text: 'Var 1 Option 2', + value: 'value2', + }, + ], + }, type: 'custom', }, }; @@ -807,39 +824,56 @@ const responseForAdvancedCustomVariableWithoutOptText = { advCustomWithoutOptText: { label: 'Options without text', value: 'value2', - options: [ - { - default: false, - text: 'value1', - value: 'value1', - }, - { - default: true, - text: 'value2', - value: 'value2', - }, - ], + options: { + values: [ + { + default: false, + text: 'value1', + value: 'value1', + }, + { + default: true, + text: 'value2', + value: 'value2', + }, + ], + }, type: 'custom', }, }; +const responseForMetricLabelValues = { + simple: { + label: 'Metric Label Values', + type: 'metric_label_values', + value: null, + options: { + prometheusEndpointPath: '/series', + label: 'backend', + values: [], + }, + }, +}; + const responseForAdvancedCustomVariable = { ...responseForSimpleCustomVariable, advCustomNormal: { label: 'Advanced Var', value: 'value2', - options: [ - { - default: false, - text: 'Var 1 Option 1', - value: 'value1', - }, - { - default: true, - text: 'Var 1 Option 2', - value: 'value2', - }, - ], + options: { + values: [ + { + default: false, + text: 'Var 1 Option 1', + value: 'value1', + }, + { + default: true, + text: 'Var 1 Option 2', + value: 'value2', + }, + ], + }, type: 'custom', }, }; @@ -873,6 +907,9 @@ export const mockTemplatingData = { simpleCustom: templatingVariableTypes.custom.simple, advCustomNormal: templatingVariableTypes.custom.advanced.normal, }), + metricLabelValues: generateMockTemplatingData({ + simple: templatingVariableTypes.metricLabelValues.simple, + }), allVariableTypes: generateMockTemplatingData({ simpleText: templatingVariableTypes.text.simple, advText: templatingVariableTypes.text.advanced, @@ -893,4 +930,5 @@ export const mockTemplatingDataResponses = { advCustomWithoutOptText: responseForAdvancedCustomVariableWithoutOptText, simpleAndAdv: responseForAdvancedCustomVariable, allVariableTypes: responsesForAllVariableTypes, + metricLabelValues: responseForMetricLabelValues, }; |