mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 09:21:43 +00:00
[Plot] Update specs
Update specs with minor changes related to using telemetrySubscriber to populate plot with streaming data, WTD-751 and WTD-784.
This commit is contained in:
parent
757665683e
commit
e6f1328d9d
@ -135,6 +135,22 @@ define(
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("provides access to a drawable object", function () {
|
||||||
|
expect(typeof subplot.getDrawingObject()).toEqual('object');
|
||||||
|
});
|
||||||
|
|
||||||
|
it("allows a domain offset to be provided", function () {
|
||||||
|
// Domain object is needed to adjust canvas coordinates
|
||||||
|
// to avoid loss-of-precision associated with converting
|
||||||
|
// to 32 bit floats.
|
||||||
|
subplot.setDomainOffset(3);
|
||||||
|
subplot.update();
|
||||||
|
// Should have adjusted the origin accordingly
|
||||||
|
expect(subplot.getDrawingObject().origin[0])
|
||||||
|
.toEqual(2);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
@ -1,4 +1,4 @@
|
|||||||
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine,Float32Array*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MergeModelsSpec. Created by vwoeltje on 11/6/14.
|
* MergeModelsSpec. Created by vwoeltje on 11/6/14.
|
||||||
@ -60,6 +60,13 @@ define(
|
|||||||
expect(preparer.getDimensions[1]).not.toEqual(0);
|
expect(preparer.getDimensions[1]).not.toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("provides buffers", function () {
|
||||||
|
var datas = [makeMockData(0)],
|
||||||
|
preparer = new PlotPreparer(datas);
|
||||||
|
expect(preparer.getBuffers()[0] instanceof Float32Array)
|
||||||
|
.toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
@ -13,6 +13,7 @@ define(
|
|||||||
mockTelemetry,
|
mockTelemetry,
|
||||||
mockUnsubscribe,
|
mockUnsubscribe,
|
||||||
mockSeries,
|
mockSeries,
|
||||||
|
testMetadata,
|
||||||
subscription;
|
subscription;
|
||||||
|
|
||||||
function mockPromise(value) {
|
function mockPromise(value) {
|
||||||
@ -24,6 +25,8 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
testMetadata = { someKey: "some value" };
|
||||||
|
|
||||||
mockQ = jasmine.createSpyObj("$q", ["when", "all"]);
|
mockQ = jasmine.createSpyObj("$q", ["when", "all"]);
|
||||||
mockTimeout = jasmine.createSpy("$timeout");
|
mockTimeout = jasmine.createSpy("$timeout");
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
mockDomainObject = jasmine.createSpyObj(
|
||||||
@ -48,6 +51,7 @@ define(
|
|||||||
mockDomainObject.getId.andReturn('test-id');
|
mockDomainObject.getId.andReturn('test-id');
|
||||||
|
|
||||||
mockTelemetry.subscribe.andReturn(mockUnsubscribe);
|
mockTelemetry.subscribe.andReturn(mockUnsubscribe);
|
||||||
|
mockTelemetry.getMetadata.andReturn(testMetadata);
|
||||||
|
|
||||||
mockSeries.getPointCount.andReturn(42);
|
mockSeries.getPointCount.andReturn(42);
|
||||||
mockSeries.getDomainValue.andReturn(123456);
|
mockSeries.getDomainValue.andReturn(123456);
|
||||||
@ -161,6 +165,11 @@ define(
|
|||||||
// Should have only triggered the
|
// Should have only triggered the
|
||||||
expect(mockCallback.calls.length).toEqual(100);
|
expect(mockCallback.calls.length).toEqual(100);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("provides domain object metadata", function () {
|
||||||
|
expect(subscription.getMetadata()[0])
|
||||||
|
.toEqual(testMetadata);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user