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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 00:09:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-04 00:09:56 +0300
commitc1a50b8195f4e36fda9b233acbde57a449bcf6c3 (patch)
treeb24a10a7951e9a799397753d1badf6894fe03089 /spec/frontend/notes
parentb6847c621ff246e6abceb90545d5a608318762d6 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r--spec/frontend/notes/components/sort_discussion_spec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/frontend/notes/components/sort_discussion_spec.js b/spec/frontend/notes/components/sort_discussion_spec.js
index 785e8c75233..724c77eee3d 100644
--- a/spec/frontend/notes/components/sort_discussion_spec.js
+++ b/spec/frontend/notes/components/sort_discussion_spec.js
@@ -3,6 +3,7 @@ import Vuex from 'vuex';
import SortDiscussion from '~/notes/components/sort_discussion.vue';
import createStore from '~/notes/stores';
import { ASC, DESC } from '~/notes/constants';
+import Tracking from '~/tracking';
const localVue = createLocalVue();
localVue.use(Vuex);
@@ -22,6 +23,7 @@ describe('Sort Discussion component', () => {
beforeEach(() => {
store = createStore();
+ jest.spyOn(Tracking, 'event');
});
afterEach(() => {
@@ -37,6 +39,9 @@ describe('Sort Discussion component', () => {
wrapper.find('.js-newest-first').trigger('click');
expect(store.dispatch).toHaveBeenCalledWith('setDiscussionSortDirection', DESC);
+ expect(Tracking.event).toHaveBeenCalledWith(undefined, 'change_discussion_sort_direction', {
+ property: DESC,
+ });
});
});
@@ -58,6 +63,9 @@ describe('Sort Discussion component', () => {
wrapper.find('.js-oldest-first').trigger('click');
expect(store.dispatch).toHaveBeenCalledWith('setDiscussionSortDirection', ASC);
+ expect(Tracking.event).toHaveBeenCalledWith(undefined, 'change_discussion_sort_direction', {
+ property: ASC,
+ });
});
it('applies the active class to the correct button in the dropdown', () => {