Permalink
Browse files

fix(metrics): ensure deviceId falls back to `none` if not set

  • Loading branch information...
philbooth committed Jan 11, 2019
1 parent 9fd5b6f commit 73485ab277cff5011739267b28942fa2a5a7b03e
Showing with 5 additions and 1 deletion.
  1. +1 −1 app/scripts/lib/metrics.js
  2. +4 −0 app/tests/spec/lib/metrics.js
@@ -350,7 +350,7 @@ define(function (require, exports, module) {
const allData = _.extend({}, loadData, unloadData, {
broker: this._brokerType,
context: this._context,
deviceId: flowData.deviceId,
deviceId: flowData.deviceId || NOT_REPORTED_VALUE,
emailDomain: this._emailDomain,
entrypoint: this._entrypoint,
experiments: flattenHashIntoArrayOfObjects(this._activeExperiments),
@@ -98,6 +98,10 @@ define(function (require, exports, module) {
});
});

it('deviceId defaults to NOT_REPORTED_VALUE', () => {
assert.equal(metrics.getAllData().deviceId, 'none');
});

describe('trigger flow.initialize event', () => {
beforeEach(() => {
notifier.trigger('flow.initialize');

0 comments on commit 73485ab

Please sign in to comment.