diff options
Diffstat (limited to 'spec/frontend/monitoring/components/variables_section_spec.js')
-rw-r--r-- | spec/frontend/monitoring/components/variables_section_spec.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/spec/frontend/monitoring/components/variables_section_spec.js b/spec/frontend/monitoring/components/variables_section_spec.js index 095d89c9231..fd814e81c8f 100644 --- a/spec/frontend/monitoring/components/variables_section_spec.js +++ b/spec/frontend/monitoring/components/variables_section_spec.js @@ -57,8 +57,7 @@ describe('Metrics dashboard/variables section component', () => { }); describe('when changing the variable inputs', () => { - const fetchDashboardData = jest.fn(); - const updateVariableValues = jest.fn(); + const updateVariablesAndFetchData = jest.fn(); beforeEach(() => { store = new Vuex.Store({ @@ -67,11 +66,10 @@ describe('Metrics dashboard/variables section component', () => { namespaced: true, state: { showEmptyState: false, - promVariables: sampleVariables, + variables: sampleVariables, }, actions: { - fetchDashboardData, - updateVariableValues, + updateVariablesAndFetchData, }, }, }, @@ -86,13 +84,12 @@ describe('Metrics dashboard/variables section component', () => { firstInput.vm.$emit('onUpdate', 'label1', 'test'); return wrapper.vm.$nextTick(() => { - expect(updateVariableValues).toHaveBeenCalled(); + expect(updateVariablesAndFetchData).toHaveBeenCalled(); expect(mergeUrlParams).toHaveBeenCalledWith( convertVariablesForURL(sampleVariables), window.location.href, ); expect(updateHistory).toHaveBeenCalled(); - expect(fetchDashboardData).toHaveBeenCalled(); }); }); @@ -102,13 +99,12 @@ describe('Metrics dashboard/variables section component', () => { firstInput.vm.$emit('onUpdate', 'label1', 'test'); return wrapper.vm.$nextTick(() => { - expect(updateVariableValues).toHaveBeenCalled(); + expect(updateVariablesAndFetchData).toHaveBeenCalled(); expect(mergeUrlParams).toHaveBeenCalledWith( convertVariablesForURL(sampleVariables), window.location.href, ); expect(updateHistory).toHaveBeenCalled(); - expect(fetchDashboardData).toHaveBeenCalled(); }); }); @@ -117,10 +113,9 @@ describe('Metrics dashboard/variables section component', () => { firstInput.vm.$emit('onUpdate', 'label1', 'Simple text'); - expect(updateVariableValues).not.toHaveBeenCalled(); + expect(updateVariablesAndFetchData).not.toHaveBeenCalled(); expect(mergeUrlParams).not.toHaveBeenCalled(); expect(updateHistory).not.toHaveBeenCalled(); - expect(fetchDashboardData).not.toHaveBeenCalled(); }); }); }); |