[Plot] Add test case

Add test case which exercises handling of historical telemetry,
WTD-806.
This commit is contained in:
Victor Woeltjen 2015-04-20 17:04:34 -07:00
parent 6400a670fa
commit 186ae05686

View File

@ -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);