diff --git a/platform/features/conductor/test/ConductorRepresenterSpec.js b/platform/features/conductor/test/ConductorRepresenterSpec.js index 0f152077d2..5d78c8a720 100644 --- a/platform/features/conductor/test/ConductorRepresenterSpec.js +++ b/platform/features/conductor/test/ConductorRepresenterSpec.js @@ -129,11 +129,12 @@ define( it("exposes conductor state in scope", function () { mockConductor.displayStart.andReturn(1977); mockConductor.displayEnd.andReturn(1984); + mockConductor.domain.andReturn('d'); representer.represent(testViews[0], {}); expect(mockNewScope.ngModel.conductor).toEqual({ - inner: { start: 1977, end: 1984 }, - outer: { start: 1977, end: 1984 } + inner: { start: 1977, end: 1984, domain: 'd' }, + outer: { start: 1977, end: 1984, domain: 'd' } }); }); @@ -163,7 +164,9 @@ define( }); describe("when bounds are changing", function () { - var mockThrottledFn = jasmine.createSpy('throttledFn'), + var startWatch = "ngModel.conductor.inner.start", + endWatch = "ngModel.conductor.inner.end", + mockThrottledFn = jasmine.createSpy('throttledFn'), testBounds; function fireThrottledFn() { @@ -174,7 +177,7 @@ define( mockThrottle.andReturn(mockThrottledFn); representer.represent(testViews[0], {}); testBounds = { start: 0, end: 1000 }; - mockNewScope.conductor.inner = testBounds; + mockNewScope.ngModel.conductor.inner = testBounds; mockConductor.displayStart.andCallFake(function () { return testBounds.start; }); @@ -186,14 +189,14 @@ define( it("does not broadcast while bounds are changing", function () { expect(mockScope.$broadcast).not.toHaveBeenCalled(); testBounds.start = 100; - fireWatch(mockNewScope, 'conductor.inner.start', testBounds.start); + fireWatch(mockNewScope, startWatch, testBounds.start); testBounds.end = 500; - fireWatch(mockNewScope, 'conductor.inner.end', testBounds.end); + fireWatch(mockNewScope, endWatch, testBounds.end); fireThrottledFn(); testBounds.start = 200; - fireWatch(mockNewScope, 'conductor.inner.start', testBounds.start); + fireWatch(mockNewScope, startWatch, testBounds.start); testBounds.end = 400; - fireWatch(mockNewScope, 'conductor.inner.end', testBounds.end); + fireWatch(mockNewScope, endWatch, testBounds.end); fireThrottledFn(); expect(mockScope.$broadcast).not.toHaveBeenCalled(); }); @@ -201,12 +204,12 @@ define( it("does broadcast when bounds have stabilized", function () { expect(mockScope.$broadcast).not.toHaveBeenCalled(); testBounds.start = 100; - fireWatch(mockNewScope, 'conductor.inner.start', testBounds.start); + fireWatch(mockNewScope, startWatch, testBounds.start); testBounds.end = 500; - fireWatch(mockNewScope, 'conductor.inner.end', testBounds.end); + fireWatch(mockNewScope, endWatch, testBounds.end); fireThrottledFn(); - fireWatch(mockNewScope, 'conductor.inner.start', testBounds.start); - fireWatch(mockNewScope, 'conductor.inner.end', testBounds.end); + fireWatch(mockNewScope, startWatch, testBounds.start); + fireWatch(mockNewScope, endWatch, testBounds.end); fireThrottledFn(); expect(mockScope.$broadcast).toHaveBeenCalled(); }); diff --git a/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js b/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js index a99bcabcd0..6e768419c1 100644 --- a/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js +++ b/platform/features/conductor/test/ConductorTelemetryDecoratorSpec.js @@ -75,8 +75,6 @@ define( return j * j * j; }); - mockConductor.queryStart.andReturn(-12321); - mockConductor.queryEnd.andReturn(-12321); mockConductor.displayStart.andReturn(42); mockConductor.displayEnd.andReturn(1977); mockConductor.domain.andReturn("testDomain"); @@ -132,29 +130,29 @@ define( expect(request.domain).toEqual(mockConductor.domain()); }); }); -// -// it("adds display start/end times & domain selection to historical requests", function () { -// decorator.requestTelemetry([{ someKey: "some value" }]); -// expect(mockTelemetryService.requestTelemetry) -// .toHaveBeenCalledWith([{ -// someKey: "some value", -// start: mockConductor.displayStart(), -// end: mockConductor.displayEnd(), -// domain: jasmine.any(String) -// }]); -// }); -// -// it("adds display start/end times & domain selection to subscription requests", function () { -// var mockCallback = jasmine.createSpy('callback'); -// decorator.subscribe(mockCallback, [{ someKey: "some value" }]); -// expect(mockTelemetryService.subscribe) -// .toHaveBeenCalledWith(jasmine.any(Function), [{ -// someKey: "some value", -// start: mockConductor.displayStart(), -// end: mockConductor.displayEnd(), -// domain: jasmine.any(String) -// }]); -// }); + + it("adds display start/end times & domain selection to historical requests", function () { + decorator.requestTelemetry([{ someKey: "some value" }]); + expect(mockTelemetryService.requestTelemetry) + .toHaveBeenCalledWith([{ + someKey: "some value", + start: mockConductor.displayStart(), + end: mockConductor.displayEnd(), + domain: jasmine.any(String) + }]); + }); + + it("adds display start/end times & domain selection to subscription requests", function () { + var mockCallback = jasmine.createSpy('callback'); + decorator.subscribe(mockCallback, [{ someKey: "some value" }]); + expect(mockTelemetryService.subscribe) + .toHaveBeenCalledWith(jasmine.any(Function), [{ + someKey: "some value", + start: mockConductor.displayStart(), + end: mockConductor.displayEnd(), + domain: jasmine.any(String) + }]); + }); }); diff --git a/platform/features/conductor/test/TestTimeConductor.js b/platform/features/conductor/test/TestTimeConductor.js index 5c8b95896f..01fed0c8fd 100644 --- a/platform/features/conductor/test/TestTimeConductor.js +++ b/platform/features/conductor/test/TestTimeConductor.js @@ -24,6 +24,8 @@ define( ["../src/TimeConductor"], function (TimeConductor) { + 'use strict'; + function TestTimeConductor() { var self = this;