diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-02 12:09:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-02 12:09:00 +0300 |
commit | 6aab18704a534ea04f7477146aaa02104e738fcb (patch) | |
tree | af58b02aa16e19702244217dd9ed4feb966f1ab5 /spec/frontend | |
parent | 3c2841692ed3560cb5d0db30f9828d30e666aa47 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/monitoring/store/actions_spec.js | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/spec/frontend/monitoring/store/actions_spec.js b/spec/frontend/monitoring/store/actions_spec.js index 5af13c0987a..0e28b70a760 100644 --- a/spec/frontend/monitoring/store/actions_spec.js +++ b/spec/frontend/monitoring/store/actions_spec.js @@ -63,11 +63,17 @@ describe('Monitoring store actions', () => { let store; let state; + let dispatch; + let commit; + beforeEach(() => { store = createStore({ getters }); state = store.state.monitoringDashboard; mock = new MockAdapter(axios); + commit = jest.fn(); + dispatch = jest.fn(); + jest.spyOn(commonUtils, 'backOff').mockImplementation(callback => { const q = new Promise((resolve, reject) => { const stop = arg => (arg instanceof Error ? reject(arg) : resolve(arg)); @@ -200,12 +206,8 @@ describe('Monitoring store actions', () => { // Metrics dashboard describe('fetchDashboard', () => { - let dispatch; - let commit; const response = metricsDashboardResponse; beforeEach(() => { - dispatch = jest.fn(); - commit = jest.fn(); state.dashboardEndpoint = '/dashboard'; }); @@ -292,14 +294,6 @@ describe('Monitoring store actions', () => { }); describe('receiveMetricsDashboardSuccess', () => { - let commit; - let dispatch; - - beforeEach(() => { - commit = jest.fn(); - dispatch = jest.fn(); - }); - it('stores groups', () => { const response = metricsDashboardResponse; receiveMetricsDashboardSuccess({ state, commit, dispatch }, { response }); @@ -359,13 +353,8 @@ describe('Monitoring store actions', () => { // Metrics describe('fetchDashboardData', () => { - let commit; - let dispatch; - beforeEach(() => { jest.spyOn(Tracking, 'event'); - commit = jest.fn(); - dispatch = jest.fn(); state.timeRange = defaultTimeRange; }); |