diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-07 18:09:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-07 18:09:49 +0300 |
commit | f276d294878605e289c84beb53032b40c53ba961 (patch) | |
tree | 20ca851593d31f5d5fabcaa15a23c9b607df04f5 /spec/frontend/static_site_editor | |
parent | 100b1a03e603487ff1966f513ba1a177a8adaefd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/static_site_editor')
-rw-r--r-- | spec/frontend/static_site_editor/services/submit_content_changes_spec.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/frontend/static_site_editor/services/submit_content_changes_spec.js b/spec/frontend/static_site_editor/services/submit_content_changes_spec.js index 5018da7300b..b75c0b7df8c 100644 --- a/spec/frontend/static_site_editor/services/submit_content_changes_spec.js +++ b/spec/frontend/static_site_editor/services/submit_content_changes_spec.js @@ -9,6 +9,8 @@ import { SUBMIT_CHANGES_MERGE_REQUEST_ERROR, TRACKING_ACTION_CREATE_COMMIT, TRACKING_ACTION_CREATE_MERGE_REQUEST, + USAGE_PING_TRACKING_ACTION_CREATE_COMMIT, + USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST, } from '~/static_site_editor/constants'; import generateBranchName from '~/static_site_editor/services/generate_branch_name'; import submitContentChanges from '~/static_site_editor/services/submit_content_changes'; @@ -201,4 +203,26 @@ describe('submitContentChanges', () => { ); }); }); + + describe('sends the correct Usage Ping tracking event', () => { + beforeEach(() => { + jest.spyOn(Api, 'trackRedisCounterEvent').mockResolvedValue({ data: '' }); + }); + + it('for commiting changes', () => { + return submitContentChanges(buildPayload()).then(() => { + expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith( + USAGE_PING_TRACKING_ACTION_CREATE_COMMIT, + ); + }); + }); + + it('for creating a merge request', () => { + return submitContentChanges(buildPayload()).then(() => { + expect(Api.trackRedisCounterEvent).toHaveBeenCalledWith( + USAGE_PING_TRACKING_ACTION_CREATE_MERGE_REQUEST, + ); + }); + }); + }); }); |