diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-29 10:12:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-29 10:12:44 +0300 |
commit | 6a4f265c940d3d0a9aeacf09222920d7d2cc4e45 (patch) | |
tree | 4cf73897e78f8fee50e39edb7d74fa628b6a87da /spec/frontend/monitoring | |
parent | cba453953c1598f83b2ed72bc012b65e0df5b767 (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/frontend/monitoring')
-rw-r--r-- | spec/frontend/monitoring/store/getters_spec.js | 26 |
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({}); }); }); |