mirror of
https://github.com/nasa/openmct.git
synced 2024-12-29 17:38:53 +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']);
|
mockQ = jasmine.createSpyObj('$q', ['when', 'all']);
|
||||||
mockSubscription = jasmine.createSpyObj(
|
mockSubscription = jasmine.createSpyObj(
|
||||||
'subscription',
|
'subscription',
|
||||||
['unsubscribe', 'getTelemetryObjects', 'promiseTelemetryObjects']
|
[
|
||||||
|
'makeDatum',
|
||||||
|
'getDatum',
|
||||||
|
'unsubscribe',
|
||||||
|
'getTelemetryObjects',
|
||||||
|
'promiseTelemetryObjects'
|
||||||
|
]
|
||||||
);
|
);
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
mockDomainObject = jasmine.createSpyObj(
|
||||||
'domainObject',
|
'domainObject',
|
||||||
@ -112,6 +118,20 @@ define(
|
|||||||
expect(handle.getSeries(mockDomainObject))
|
expect(handle.getSeries(mockDomainObject))
|
||||||
.toEqual(mockSeries);
|
.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