summaryrefslogtreecommitdiff
path: root/spec/frontend
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-29 07:12:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-29 07:12:44 +0000
commit6a4f265c940d3d0a9aeacf09222920d7d2cc4e45 (patch)
tree4cf73897e78f8fee50e39edb7d74fa628b6a87da /spec/frontend
parentcba453953c1598f83b2ed72bc012b65e0df5b767 (diff)
downloadgitlab-ce-6a4f265c940d3d0a9aeacf09222920d7d2cc4e45.tar.gz
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/monitoring/store/getters_spec.js26
1 files changed, 11 insertions, 15 deletions
diff --git a/spec/frontend/monitoring/store/getters_spec.js b/spec/frontend/monitoring/store/getters_spec.js
index 365052e68e3..19ca001c281 100644
--- a/spec/frontend/monitoring/store/getters_spec.js
+++ b/spec/frontend/monitoring/store/getters_spec.js
@@ -329,7 +329,7 @@ describe('Monitoring store Getters', () => {
});
});
- describe('getCustomVariablesArray', () => {
+ describe('getCustomVariablesParams', () => {
let state;
beforeEach(() => {
@@ -340,25 +340,21 @@ describe('Monitoring store Getters', () => {
it('transforms the promVariables object to an array in the [variable, variable_value] format for all variable types', () => {
mutations[types.SET_VARIABLES](state, mockTemplatingDataResponses.allVariableTypes);
- const variablesArray = getters.getCustomVariablesArray(state);
-
- expect(variablesArray).toEqual([
- 'simpleText',
- 'Simple text',
- 'advText',
- 'default',
- 'simpleCustom',
- 'value1',
- 'advCustomNormal',
- 'value2',
- ]);
+ const variablesArray = getters.getCustomVariablesParams(state);
+
+ expect(variablesArray).toEqual({
+ 'variables[advCustomNormal]': 'value2',
+ 'variables[advText]': 'default',
+ 'variables[simpleCustom]': 'value1',
+ 'variables[simpleText]': 'Simple text',
+ });
});
it('transforms the promVariables object to an empty array when no keys are present', () => {
mutations[types.SET_VARIABLES](state, {});
- const variablesArray = getters.getCustomVariablesArray(state);
+ const variablesArray = getters.getCustomVariablesParams(state);
- expect(variablesArray).toEqual([]);
+ expect(variablesArray).toEqual({});
});
});