mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 13:18:15 +00:00
squash merge open933 into integration-1089, resolve merge conflicts.
This commit is contained in:
@ -39,6 +39,7 @@ define(
|
||||
mockHandle,
|
||||
mockDomainObject,
|
||||
mockSeries,
|
||||
mockStatusCapability,
|
||||
controller;
|
||||
|
||||
function bind(method, thisObj) {
|
||||
@ -80,7 +81,7 @@ define(
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
"domainObject",
|
||||
["getId", "getModel", "getCapability"]
|
||||
["getId", "getModel", "getCapability", "hasCapability"]
|
||||
);
|
||||
mockHandler = jasmine.createSpyObj(
|
||||
"telemetrySubscriber",
|
||||
@ -104,6 +105,11 @@ define(
|
||||
['getPointCount', 'getDomainValue', 'getRangeValue']
|
||||
);
|
||||
|
||||
mockStatusCapability = jasmine.createSpyObj(
|
||||
"statusCapability",
|
||||
["set"]
|
||||
);
|
||||
|
||||
mockHandler.handle.andReturn(mockHandle);
|
||||
mockThrottle.andCallFake(function (fn) {
|
||||
return fn;
|
||||
@ -241,6 +247,34 @@ define(
|
||||
expect(bind(controller.unzoom, controller)).not.toThrow();
|
||||
});
|
||||
|
||||
it("sets status when plot becomes detached from time conductor", function () {
|
||||
mockScope.$watch.mostRecentCall.args[1](mockDomainObject);
|
||||
|
||||
function boundsEvent() {
|
||||
fireEvent("telemetry:display:bounds", [
|
||||
{},
|
||||
{ start: 10, end: 100 },
|
||||
true
|
||||
]);
|
||||
}
|
||||
|
||||
mockDomainObject.hasCapability.andCallFake(function (name) {
|
||||
return name === "status";
|
||||
});
|
||||
mockDomainObject.getCapability.andReturn(mockStatusCapability);
|
||||
spyOn(controller, "isZoomed");
|
||||
|
||||
//Mock zoomed in state
|
||||
controller.isZoomed.andReturn(true);
|
||||
boundsEvent();
|
||||
expect(mockStatusCapability.set).toHaveBeenCalledWith("timeconductor-unsynced", true);
|
||||
|
||||
//"Reset" zoom
|
||||
controller.isZoomed.andReturn(false);
|
||||
boundsEvent();
|
||||
expect(mockStatusCapability.set).toHaveBeenCalledWith("timeconductor-unsynced", false);
|
||||
});
|
||||
|
||||
it("indicates if a request is pending", function () {
|
||||
mockScope.$watch.mostRecentCall.args[1](mockDomainObject);
|
||||
expect(controller.isRequestPending()).toBeTruthy();
|
||||
@ -297,7 +331,6 @@ define(
|
||||
expect(mockHandle.request.calls.length).toEqual(2);
|
||||
});
|
||||
|
||||
|
||||
it("maintains externally-provided domain axis bounds after data is received", function () {
|
||||
mockSeries.getPointCount.andReturn(3);
|
||||
mockSeries.getRangeValue.andReturn(42);
|
||||
|
Reference in New Issue
Block a user