Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/batch_comments/components/submit_dropdown_spec.js')
-rw-r--r--spec/frontend/batch_comments/components/submit_dropdown_spec.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/frontend/batch_comments/components/submit_dropdown_spec.js b/spec/frontend/batch_comments/components/submit_dropdown_spec.js
index 5c33df882bf..7e2ff7f786f 100644
--- a/spec/frontend/batch_comments/components/submit_dropdown_spec.js
+++ b/spec/frontend/batch_comments/components/submit_dropdown_spec.js
@@ -3,6 +3,7 @@ import Vue from 'vue';
import Vuex from 'vuex';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import SubmitDropdown from '~/batch_comments/components/submit_dropdown.vue';
+import { mockTracking } from 'helpers/tracking_helper';
jest.mock('~/autosave');
@@ -10,9 +11,11 @@ Vue.use(Vuex);
let wrapper;
let publishReview;
+let trackingSpy;
function factory({ canApprove = true, shouldAnimateReviewButton = false } = {}) {
publishReview = jest.fn();
+ trackingSpy = mockTracking(undefined, null, jest.spyOn);
const store = new Vuex.Store({
getters: {
@@ -69,6 +72,20 @@ describe('Batch comments submit dropdown', () => {
});
});
+ it('tracks submit action', () => {
+ factory();
+
+ findCommentTextarea().setValue('Hello world');
+
+ findForm().vm.$emit('submit', { preventDefault: jest.fn() });
+
+ expect(trackingSpy).toHaveBeenCalledWith(undefined, 'editor_type_used', {
+ context: 'MergeRequest_review',
+ editorType: 'editor_type_plain_text_editor',
+ label: 'editor_tracking',
+ });
+ });
+
it('switches to the overview tab after submit', async () => {
window.mrTabs = { tabShown: jest.fn() };