From 8da74f26656a2da9a5e3df61ac022f57dddd3115 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 18 Dec 2017 13:28:05 -0800 Subject: [PATCH] [Timers] Fix bug in FollowIndicator ...by expecting new-style instead of legacy domain objects. Fixes #1836 --- .../features/clock/src/indicators/FollowIndicator.js | 2 +- .../clock/test/indicators/FollowIndicatorSpec.js | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/platform/features/clock/src/indicators/FollowIndicator.js b/platform/features/clock/src/indicators/FollowIndicator.js index d20f8975d5..5b331a707a 100644 --- a/platform/features/clock/src/indicators/FollowIndicator.js +++ b/platform/features/clock/src/indicators/FollowIndicator.js @@ -45,7 +45,7 @@ define( FollowIndicator.prototype.getText = function () { 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 () { diff --git a/platform/features/clock/test/indicators/FollowIndicatorSpec.js b/platform/features/clock/test/indicators/FollowIndicatorSpec.js index 06710dde03..0e4f4c6a01 100644 --- a/platform/features/clock/test/indicators/FollowIndicatorSpec.js +++ b/platform/features/clock/test/indicators/FollowIndicatorSpec.js @@ -42,18 +42,15 @@ define(["../../src/indicators/FollowIndicator"], function (FollowIndicator) { }); describe("when a timer is set", function () { - var testModel; - var mockDomainObject; + var testObject; beforeEach(function () { - testModel = { name: "some timer!" }; - mockDomainObject = jasmine.createSpyObj('timer', ['getModel']); - mockDomainObject.getModel.andReturn(testModel); - mockTimerService.getTimer.andReturn(mockDomainObject); + testObject = { name: "some timer!" }; + mockTimerService.getTimer.andReturn(testObject); }); it("displays the timer's name", function () { - expect(indicator.getText().indexOf(testModel.name)) + expect(indicator.getText().indexOf(testObject.name)) .not.toEqual(-1); }); });