diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 21:09:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 21:09:56 +0000 |
commit | c1a50b8195f4e36fda9b233acbde57a449bcf6c3 (patch) | |
tree | b24a10a7951e9a799397753d1badf6894fe03089 /spec/frontend/notes | |
parent | b6847c621ff246e6abceb90545d5a608318762d6 (diff) | |
download | gitlab-ce-c1a50b8195f4e36fda9b233acbde57a449bcf6c3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r-- | spec/frontend/notes/components/sort_discussion_spec.js | 8 |
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', () => { |