mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 07:16:39 +00:00
[Time Conductor] Test TelemetryHandle.getDatum
Test ability to look up datum object by index (used to support evaluation of limit state in Fixed Position and similar single-value views while time conducting.)
This commit is contained in:
parent
a49deb5ab1
commit
b9146fbeac
@ -47,7 +47,13 @@ define(
|
||||
mockQ = jasmine.createSpyObj('$q', ['when', 'all']);
|
||||
mockSubscription = jasmine.createSpyObj(
|
||||
'subscription',
|
||||
['unsubscribe', 'getTelemetryObjects', 'promiseTelemetryObjects']
|
||||
[
|
||||
'makeDatum',
|
||||
'getDatum',
|
||||
'unsubscribe',
|
||||
'getTelemetryObjects',
|
||||
'promiseTelemetryObjects'
|
||||
]
|
||||
);
|
||||
mockDomainObject = jasmine.createSpyObj(
|
||||
'domainObject',
|
||||
@ -112,6 +118,20 @@ define(
|
||||
expect(handle.getSeries(mockDomainObject))
|
||||
.toEqual(mockSeries);
|
||||
});
|
||||
|
||||
it("provides access to the datum objects by index", function () {
|
||||
var testDatum = { a: 1, b: 2 }, testIndex = 42;
|
||||
mockSubscription.makeDatum.andReturn(testDatum);
|
||||
handle.request({});
|
||||
expect(handle.getDatum(mockDomainObject, testIndex))
|
||||
.toEqual(testDatum);
|
||||
expect(mockSubscription.makeDatum)
|
||||
.toHaveBeenCalledWith(
|
||||
mockDomainObject,
|
||||
mockSeries,
|
||||
testIndex
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user