mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 06:08:11 +00:00
[Plot] Add test case
Add test case which exercises handling of historical telemetry, WTD-806.
This commit is contained in:
@ -14,6 +14,7 @@ define(
|
|||||||
mockHandler,
|
mockHandler,
|
||||||
mockHandle,
|
mockHandle,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
|
mockSeries,
|
||||||
controller;
|
controller;
|
||||||
|
|
||||||
|
|
||||||
@ -45,6 +46,10 @@ define(
|
|||||||
"request"
|
"request"
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
mockSeries = jasmine.createSpyObj(
|
||||||
|
'series',
|
||||||
|
['getPointCount', 'getDomainValue', 'getRangeValue']
|
||||||
|
);
|
||||||
|
|
||||||
mockHandler.handle.andReturn(mockHandle);
|
mockHandler.handle.andReturn(mockHandle);
|
||||||
mockHandle.getTelemetryObjects.andReturn([mockDomainObject]);
|
mockHandle.getTelemetryObjects.andReturn([mockDomainObject]);
|
||||||
@ -175,6 +180,15 @@ define(
|
|||||||
expect(controller.isRequestPending()).toBeFalsy();
|
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 () {
|
it("unsubscribes when destroyed", function () {
|
||||||
// Make an object available
|
// Make an object available
|
||||||
mockScope.$watch.mostRecentCall.args[1](mockDomainObject);
|
mockScope.$watch.mostRecentCall.args[1](mockDomainObject);
|
||||||
|
Reference in New Issue
Block a user