mirror of
https://github.com/nasa/openmct.git
synced 2024-12-22 06:27:48 +00:00
[Timers] Fix bug in FollowIndicator
...by expecting new-style instead of legacy domain objects. Fixes #1836
This commit is contained in:
parent
2390278b97
commit
8da74f2665
@ -45,7 +45,7 @@ define(
|
|||||||
|
|
||||||
FollowIndicator.prototype.getText = function () {
|
FollowIndicator.prototype.getText = function () {
|
||||||
var timer = this.timerService.getTimer();
|
var timer = this.timerService.getTimer();
|
||||||
return (timer) ? 'Following timer ' + timer.getModel().name : NO_TIMER;
|
return timer ? ('Following timer ' + timer.name) : NO_TIMER;
|
||||||
};
|
};
|
||||||
|
|
||||||
FollowIndicator.prototype.getDescription = function () {
|
FollowIndicator.prototype.getDescription = function () {
|
||||||
|
@ -42,18 +42,15 @@ define(["../../src/indicators/FollowIndicator"], function (FollowIndicator) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("when a timer is set", function () {
|
describe("when a timer is set", function () {
|
||||||
var testModel;
|
var testObject;
|
||||||
var mockDomainObject;
|
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
testModel = { name: "some timer!" };
|
testObject = { name: "some timer!" };
|
||||||
mockDomainObject = jasmine.createSpyObj('timer', ['getModel']);
|
mockTimerService.getTimer.andReturn(testObject);
|
||||||
mockDomainObject.getModel.andReturn(testModel);
|
|
||||||
mockTimerService.getTimer.andReturn(mockDomainObject);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("displays the timer's name", function () {
|
it("displays the timer's name", function () {
|
||||||
expect(indicator.getText().indexOf(testModel.name))
|
expect(indicator.getText().indexOf(testObject.name))
|
||||||
.not.toEqual(-1);
|
.not.toEqual(-1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user