diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 00:08:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 00:08:21 +0300 |
commit | e43574ee831197b604c59b80f94e30764223e5ed (patch) | |
tree | f467f4c23cd9d151b5d54711451252de94d62879 /spec/frontend/tracking | |
parent | d18b7dc5eea84db5008986c6879a24ad7f6462a6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/tracking')
-rw-r--r-- | spec/frontend/tracking/tracking_spec.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/frontend/tracking/tracking_spec.js b/spec/frontend/tracking/tracking_spec.js index b7a2e4f4f51..10380e6f4c5 100644 --- a/spec/frontend/tracking/tracking_spec.js +++ b/spec/frontend/tracking/tracking_spec.js @@ -255,6 +255,23 @@ describe('Tracking', () => { expect(snowplowSpy).toHaveBeenCalledWith('setCustomUrl', TEST_HOST); }); + describe('allowed hashes/fragments', () => { + it.each` + hash | appends | description + ${'note_abc_123'} | ${true} | ${'appends'} + ${'diff-content-819'} | ${true} | ${'appends'} + ${'first_heading'} | ${false} | ${'does not append'} + `('$description `$hash` hash', ({ hash, appends }) => { + window.gl.snowplowPseudonymizedPageUrl = TEST_HOST; + window.location.hash = hash; + + Tracking.setAnonymousUrls(); + + const url = appends ? `${TEST_HOST}#${hash}` : TEST_HOST; + expect(snowplowSpy).toHaveBeenCalledWith('setCustomUrl', url); + }); + }); + it('does not set the referrer URL by default', () => { window.gl.snowplowPseudonymizedPageUrl = TEST_HOST; |