diff options
author | Jeremy Jackson <jjackson@gitlab.com> | 2019-08-27 01:16:23 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-08-27 01:16:23 +0300 |
commit | 92b723db956e2b75b4bdcfb4d94c3c3cff8bf639 (patch) | |
tree | 9c1d60ebc1e38689428b7579d1932203a1e70a3c /spec/frontend | |
parent | 1d83240beb08aaaa240efbc8f63293019603a744 (diff) |
Revert "Merge branch 'user-tracking-settings' into 'master'"
This reverts merge request !31826
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/tracking_spec.js | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/spec/frontend/tracking_spec.js b/spec/frontend/tracking_spec.js index 7c98a1a66c9..0e862c683d3 100644 --- a/spec/frontend/tracking_spec.js +++ b/spec/frontend/tracking_spec.js @@ -1,56 +1,20 @@ import $ from 'jquery'; import { setHTMLFixture } from './helpers/fixtures'; -import Tracking, { initUserTracking } from '~/tracking'; +import Tracking from '~/tracking'; describe('Tracking', () => { - let snowplowSpy; - beforeEach(() => { window.snowplow = window.snowplow || (() => {}); - window.snowplowOptions = { - namespace: '_namespace_', - hostname: 'app.gitfoo.com', - cookieDomain: '.gitfoo.com', - }; - snowplowSpy = jest.spyOn(window, 'snowplow'); }); - describe('initUserTracking', () => { - it('calls through to get a new tracker with the expected options', () => { - initUserTracking(); - expect(snowplowSpy).toHaveBeenCalledWith('newTracker', '_namespace_', 'app.gitfoo.com', { - namespace: '_namespace_', - hostname: 'app.gitfoo.com', - cookieDomain: '.gitfoo.com', - appId: '', - userFingerprint: false, - respectDoNotTrack: true, - forceSecureTracker: true, - eventMethod: 'post', - contexts: { webPage: true }, - activityTrackingEnabled: false, - pageTrackingEnabled: false, - }); - }); - - it('should activate features based on what has been enabled', () => { - initUserTracking(); - expect(snowplowSpy).not.toHaveBeenCalledWith('enableActivityTracking', 30, 30); - expect(snowplowSpy).not.toHaveBeenCalledWith('trackPageView'); - - window.snowplowOptions = Object.assign({}, window.snowplowOptions, { - activityTrackingEnabled: true, - pageTrackingEnabled: true, - }); + describe('.event', () => { + let snowplowSpy = null; - initUserTracking(); - expect(snowplowSpy).toHaveBeenCalledWith('enableActivityTracking', 30, 30); - expect(snowplowSpy).toHaveBeenCalledWith('trackPageView'); + beforeEach(() => { + snowplowSpy = jest.spyOn(window, 'snowplow'); }); - }); - describe('.event', () => { afterEach(() => { window.doNotTrack = undefined; navigator.doNotTrack = undefined; |