diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 09:06:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 09:06:20 +0000 |
commit | 8a3fdede9607c806d88856d46d4f5394b630a006 (patch) | |
tree | 869139549ac3bd687fcf1286d6dd50b1d785702e /spec/frontend/monitoring | |
parent | 8e75748aabcbcea411f8bbc68936805bc2b5ff0c (diff) | |
download | gitlab-ce-8a3fdede9607c806d88856d46d4f5394b630a006.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/monitoring')
-rw-r--r-- | spec/frontend/monitoring/store/actions_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/monitoring/store/actions_spec.js b/spec/frontend/monitoring/store/actions_spec.js index d4bc613ffea..467e0445a90 100644 --- a/spec/frontend/monitoring/store/actions_spec.js +++ b/spec/frontend/monitoring/store/actions_spec.js @@ -1,4 +1,5 @@ import MockAdapter from 'axios-mock-adapter'; +import Tracking from '~/tracking'; import { TEST_HOST } from 'helpers/test_constants'; import testAction from 'helpers/vuex_action_helper'; import axios from '~/lib/utils/axios_utils'; @@ -226,12 +227,14 @@ describe('Monitoring store actions', () => { let state; const response = metricsDashboardResponse; beforeEach(() => { + jest.spyOn(Tracking, 'event'); dispatch = jest.fn(); state = storeState(); state.dashboardEndpoint = '/dashboard'; }); it('dispatches receive and success actions', done => { const params = {}; + document.body.dataset.page = 'projects:environments:metrics'; mock.onGet(state.dashboardEndpoint).reply(200, response); fetchDashboard( { @@ -246,6 +249,17 @@ describe('Monitoring store actions', () => { response, params, }); + }) + .then(() => { + expect(Tracking.event).toHaveBeenCalledWith( + document.body.dataset.page, + 'dashboard_fetch', + { + label: 'custom_metrics_dashboard', + property: 'count', + value: 0, + }, + ); done(); }) .catch(done.fail); |