diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 18:07:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 18:07:45 +0300 |
commit | 1219a9dce91f4edbc135dfc08299b4122b4825a8 (patch) | |
tree | e7d12a55d75a2d56e60d9527bef3724e3578866d /spec/frontend | |
parent | 1a0d6dbdc2ac3047f4953a359ef27ba6e26074ae (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/blob/pipeline_tour_success_modal_spec.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/frontend/blob/pipeline_tour_success_modal_spec.js b/spec/frontend/blob/pipeline_tour_success_modal_spec.js index 613a7ce8303..99940225652 100644 --- a/spec/frontend/blob/pipeline_tour_success_modal_spec.js +++ b/spec/frontend/blob/pipeline_tour_success_modal_spec.js @@ -2,7 +2,7 @@ import pipelineTourSuccess from '~/blob/pipeline_tour_success_modal.vue'; import { shallowMount } from '@vue/test-utils'; import Cookies from 'js-cookie'; import { GlSprintf, GlModal } from '@gitlab/ui'; -import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; +import { mockTracking, triggerEvent, unmockTracking } from 'helpers/tracking_helper'; import modalProps from './pipeline_tour_success_mock_data'; describe('PipelineTourSuccessModal', () => { @@ -16,6 +16,9 @@ describe('PipelineTourSuccessModal', () => { trackingSpy = mockTracking('_category_', undefined, jest.spyOn); wrapper = shallowMount(pipelineTourSuccess, { propsData: modalProps, + stubs: { + GlModal, + }, }); cookieSpy = jest.spyOn(Cookies, 'remove'); @@ -41,11 +44,23 @@ describe('PipelineTourSuccessModal', () => { }); describe('tracking', () => { - it('send event for basic view of popover', () => { + it('send event for basic view of modal', () => { expect(trackingSpy).toHaveBeenCalledWith(undefined, undefined, { label: 'congratulate_first_pipeline', property: modalProps.humanAccess, }); }); + + it('send an event when go to pipelines is clicked', () => { + trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn); + const goToBtn = wrapper.find({ ref: 'goto' }); + triggerEvent(goToBtn.element); + + expect(trackingSpy).toHaveBeenCalledWith('_category_', 'click_button', { + label: 'congratulate_first_pipeline', + property: modalProps.humanAccess, + value: '10', + }); + }); }); }); |