From 186ae05686485aaa7f3b40d1059441cc87e687f9 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 20 Apr 2015 17:04:34 -0700 Subject: [PATCH] [Plot] Add test case Add test case which exercises handling of historical telemetry, WTD-806. --- platform/features/plot/test/PlotControllerSpec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/features/plot/test/PlotControllerSpec.js b/platform/features/plot/test/PlotControllerSpec.js index 301873ae16..846bac452f 100644 --- a/platform/features/plot/test/PlotControllerSpec.js +++ b/platform/features/plot/test/PlotControllerSpec.js @@ -14,6 +14,7 @@ define( mockHandler, mockHandle, mockDomainObject, + mockSeries, controller; @@ -45,6 +46,10 @@ define( "request" ] ); + mockSeries = jasmine.createSpyObj( + 'series', + ['getPointCount', 'getDomainValue', 'getRangeValue'] + ); mockHandler.handle.andReturn(mockHandle); mockHandle.getTelemetryObjects.andReturn([mockDomainObject]); @@ -175,6 +180,15 @@ define( expect(controller.isRequestPending()).toBeFalsy(); }); + it("requests historical telemetry", function () { + mockScope.$watch.mostRecentCall.args[1](mockDomainObject); + expect(mockHandle.request).toHaveBeenCalled(); + mockHandle.request.mostRecentCall.args[1]( + mockDomainObject, + mockSeries + ); + }); + it("unsubscribes when destroyed", function () { // Make an object available mockScope.$watch.mostRecentCall.args[1](mockDomainObject);