diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /spec/frontend/vue_shared/directives | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'spec/frontend/vue_shared/directives')
-rw-r--r-- | spec/frontend/vue_shared/directives/track_event_spec.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/spec/frontend/vue_shared/directives/track_event_spec.js b/spec/frontend/vue_shared/directives/track_event_spec.js index b3f94d0242a..4bf84b06246 100644 --- a/spec/frontend/vue_shared/directives/track_event_spec.js +++ b/spec/frontend/vue_shared/directives/track_event_spec.js @@ -1,5 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import Vue from 'vue'; +import Vue, { nextTick } from 'vue'; import Tracking from '~/tracking'; import TrackEvent from '~/vue_shared/directives/track_event'; @@ -31,7 +31,7 @@ describe('Error Tracking directive', () => { expect(Tracking.event).not.toHaveBeenCalled(); }); - it('should track event on click if tracking info provided', () => { + it('should track event on click if tracking info provided', async () => { const trackingOptions = { category: 'Tracking', action: 'click_trackable_btn', @@ -43,9 +43,8 @@ describe('Error Tracking directive', () => { wrapper.setData({ trackingOptions }); const { category, action, label, property, value } = trackingOptions; - return wrapper.vm.$nextTick(() => { - button.trigger('click'); - expect(Tracking.event).toHaveBeenCalledWith(category, action, { label, property, value }); - }); + await nextTick(); + button.trigger('click'); + expect(Tracking.event).toHaveBeenCalledWith(category, action, { label, property, value }); }); }); |