Commit 0f48828f authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '216306-event-tracking-not-firing-for-suggest_pipeline-experiment' into 'master'

Resolve "Event tracking not firing for suggest_pipeline experiment"

Closes #216306

See merge request gitlab-org/gitlab!30894
parents 2bd9ca9c 21e3b8a4
......@@ -72,9 +72,6 @@ export default {
dismissCookieName() {
return `${this.trackLabel}_${this.dismissKey}`;
},
commitCookieName() {
return `suggest_gitlab_ci_yml_commit_${this.dismissKey}`;
},
},
mounted() {
if (
......
......@@ -106,7 +106,6 @@ function deferredInitialisation() {
initLogoAnimation();
initUsagePingConsent();
initUserPopovers();
initUserTracking();
initBroadcastNotifications();
const recoverySettingsCallout = document.querySelector('.js-recovery-settings-callout');
......@@ -187,6 +186,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (document.querySelector('#js-peek')) initPerformanceBar({ container: '#js-peek' });
initUserTracking();
initLayoutNav();
// Set the default path for all cookies to GitLab's root directory
......
import initBlobBundle from '~/blob_edit/blob_bundle';
import initPopover from '~/blob/suggest_gitlab_ci_yml';
document.addEventListener('DOMContentLoaded', () => {
initBlobBundle();
const suggestEl = document.querySelector('.js-suggest-gitlab-ci-yml');
if (suggestEl) {
initPopover(suggestEl);
}
});
document.addEventListener('DOMContentLoaded', initBlobBundle);
......@@ -12,8 +12,8 @@ describe('PipelineTourSuccessModal', () => {
beforeEach(() => {
document.body.dataset.page = 'projects:blob:show';
trackingSpy = mockTracking('_category_', undefined, jest.spyOn);
wrapper = shallowMount(pipelineTourSuccess, {
propsData: modalProps,
stubs: {
......
......@@ -69,8 +69,10 @@ describe('Suggest gitlab-ci.yml Popover', () => {
let trackingSpy;
beforeEach(() => {
document.body.dataset.page = 'projects:blob:new';
trackingSpy = mockTracking('_category_', undefined, jest.spyOn);
createWrapper(commitTrackLabel);
trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn);
});
afterEach(() => {
......@@ -83,10 +85,6 @@ describe('Suggest gitlab-ci.yml Popover', () => {
const expectedLabel = 'suggest_commit_first_project_gitlab_ci_yml';
const expectedProperty = 'owner';
document.body.dataset.page = 'projects:blob:new';
wrapper.vm.trackOnShow();
expect(trackingSpy).toHaveBeenCalledWith(expectedCategory, expectedAction, {
label: expectedLabel,
property: expectedProperty,
......@@ -99,6 +97,7 @@ describe('Suggest gitlab-ci.yml Popover', () => {
const expectedProperty = 'owner';
const expectedValue = '10';
const dismissButton = wrapper.find(GlDeprecatedButton);
trackingSpy = mockTracking('_category_', wrapper.element, jest.spyOn);
triggerEvent(dismissButton.element);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment