Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Commit

Permalink
[fix_insightkeenio] Adding tracker output spec test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuxlli committed Jun 16, 2015
1 parent 78f3dc7 commit 596afaa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
11 changes: 9 additions & 2 deletions spec/utils/tracker_spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import h from 'spec/spec_helper';
import { default as tracker } from 'azk/utils/tracker';

// azk nvm grunt --grep='Azk Tracker'
import { meta as azkMeta } from 'azk';

describe("Azk Tracker", function() {
this.timeout(2000);
Expand All @@ -22,4 +21,12 @@ describe("Azk Tracker", function() {
var expectedSessionId = tracker.loadAgentSessionId();
h.expect(sessionId).to.equal(expectedSessionId);
});

it("should override insight get/set for optout", function() {
return azkMeta.cleanAsync().then(() => {
tracker.insight.optOut = true;
var metaOptout = azkMeta.get(tracker.insight_opts.opt_out_key);
h.expect(metaOptout).to.equal(false);
});
});
});
13 changes: 8 additions & 5 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ var options = mergeConfig({
},
// jscs:disable maximumLineLength
tracker: {
permission_key: 'tracker_permission',
disable: envs('AZK_DISABLE_TRACKER', false),
projectId: envs('AZK_KEEN_PROJECT_ID', '552818c790e4bd7f7bd8baba'),
writeKey: envs('AZK_KEEN_WRITE_KEY', 'e2c70b3dd3ed3003a09a1bc7d8622ad9220fe33069d81164f0fafa13baf11458e48736f6cbcc995a8346183b290597504feb4bef06f71350f4859df5eb271a1d845f7cff5c9dfddf2f03de1e39760c6e51a06fb9e347c2e1fb98d3c6d370e6916e5db8810ddd9c0d5d83540386ccfe2e'),
Expand Down Expand Up @@ -136,11 +137,8 @@ var options = mergeConfig({
},
test: {
paths: {
// jscs:disable maximumLineLength
log : path.join(paths.logs, 'azk_test.log'),
projectId: envs('AZK_KEEN_PROJECT_ID', '5526968d672e6c5a0d0ebec6'),
writeKey: envs('AZK_KEEN_WRITE_KEY', '5dbce13e376070e36eec0c7dd1e7f42e49f39b4db041f208054617863832309c14a797409e12d976630c3a4b479004f26b362506e82a46dd54df0c977a7378da280c05ae733c97abb445f58abb56ae15f561ac9ad774cea12c3ad8628d896c39f6e702f6b035541fc1a562997cb05768'),
// jscs:enabled maximumLineLength
log : path.join(paths.logs, 'azk_test.log'),
azk_meta: path.join(data_path, azk_dir, "shared", "test-Azkfile.js"),
},
docker: {
namespace : 'azk.test',
Expand All @@ -150,6 +148,11 @@ var options = mergeConfig({
},
tracker: {
disable: true,
// jscs:disable maximumLineLength
permission_key: 'tracker_permission_test',
projectId : envs('AZK_KEEN_PROJECT_ID', '5526968d672e6c5a0d0ebec6'),
writeKey : envs('AZK_KEEN_WRITE_KEY', '5dbce13e376070e36eec0c7dd1e7f42e49f39b4db041f208054617863832309c14a797409e12d976630c3a4b479004f26b362506e82a46dd54df0c977a7378da280c05ae733c97abb445f58abb56ae15f561ac9ad774cea12c3ad8628d896c39f6e702f6b035541fc1a562997cb05768'),
// jscs:enabled maximumLineLength
},
logs_level: {
console: (envs('AZK_DEBUG') ? 'debug' : 'warn'),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class Tracker {

// Default tracker
var default_tracker = new Tracker({}, {
permission: 'tracker_permission',
permission: config('tracker:permission_key'),
user_id : 'tracker_user_id',
agent_id : 'agent_session_id',
});
Expand Down

0 comments on commit 596afaa

Please sign in to comment.