Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-22 18:10:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-22 18:10:48 +0300
commit232e7582b0e81e95bd721ad8094fcb50ecbc8a04 (patch)
treea68e00760d0a3446c2030addd679b33acfa39d2d /spec/frontend/tracking_spec.js
parent980d813e90c70f09861e39b9269e73b2c9a4e936 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/tracking_spec.js')
-rw-r--r--spec/frontend/tracking_spec.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/frontend/tracking_spec.js b/spec/frontend/tracking_spec.js
index be86e8ed90f..d4dddbe0d82 100644
--- a/spec/frontend/tracking_spec.js
+++ b/spec/frontend/tracking_spec.js
@@ -78,6 +78,34 @@ describe('Tracking', () => {
navigator.msDoNotTrack = undefined;
});
+ describe('builds the standard context', () => {
+ let standardContext;
+
+ beforeAll(async () => {
+ window.gl = window.gl || {};
+ window.gl.snowplowStandardContext = {
+ schema: 'iglu:com.gitlab/gitlab_standard',
+ data: {
+ environment: 'testing',
+ source: 'unknown',
+ },
+ };
+
+ jest.resetModules();
+
+ ({ STANDARD_CONTEXT: standardContext } = await import('~/tracking'));
+ });
+
+ it('uses server data', () => {
+ expect(standardContext.schema).toBe('iglu:com.gitlab/gitlab_standard');
+ expect(standardContext.data.environment).toBe('testing');
+ });
+
+ it('overrides schema source', () => {
+ expect(standardContext.data.source).toBe('gitlab-javascript');
+ });
+ });
+
it('tracks to snowplow (our current tracking system)', () => {
Tracking.event('_category_', '_eventName_', { label: '_label_' });