diff --git a/platform/features/clock/test/actions/PauseTimerActionSpec.js b/platform/features/clock/test/actions/PauseTimerActionSpec.js index 7cf230968f..098e29c634 100644 --- a/platform/features/clock/test/actions/PauseTimerActionSpec.js +++ b/platform/features/clock/test/actions/PauseTimerActionSpec.js @@ -39,6 +39,18 @@ define( }; } + function testState(type, timerState, timestamp, expected) { + testModel.type = type; + testModel.timerState = timerState; + testModel.timestamp = timestamp; + + if (expected) { + expect(PauseTimerAction.appliesTo(testContext)).toBeTruthy(); + } else { + expect(PauseTimerAction.appliesTo(testContext)).toBeFalsy(); + } + } + beforeEach(function () { mockNow = jasmine.createSpy('now'); mockDomainObject = jasmine.createSpyObj( @@ -88,18 +100,6 @@ define( //not a timer testState('clock', 'started', 12000, false); }); - - function testState(type, timerState, timestamp, expected) { - testModel.type = type; - testModel.timerState = timerState; - testModel.timestamp = timestamp; - - if (expected) { - expect(PauseTimerAction.appliesTo(testContext)).toBeTruthy() - } else { - expect(PauseTimerAction.appliesTo(testContext)).toBeFalsy() - } - } }); } ); diff --git a/platform/features/clock/test/actions/RestartTimerActionSpec.js b/platform/features/clock/test/actions/RestartTimerActionSpec.js index e1bddbe4eb..fc1978322f 100644 --- a/platform/features/clock/test/actions/RestartTimerActionSpec.js +++ b/platform/features/clock/test/actions/RestartTimerActionSpec.js @@ -39,6 +39,18 @@ define( }; } + function testState(type, timerState, timestamp, expected) { + testModel.type = type; + testModel.timerState = timerState; + testModel.timestamp = timestamp; + + if (expected) { + expect(RestartTimerAction.appliesTo(testContext)).toBeTruthy(); + } else { + expect(RestartTimerAction.appliesTo(testContext)).toBeFalsy(); + } + } + beforeEach(function () { mockNow = jasmine.createSpy('now'); mockDomainObject = jasmine.createSpyObj( @@ -94,18 +106,6 @@ define( //not a timer testState('clock', 'paused', 12000, false); }); - - function testState(type, timerState, timestamp, expected) { - testModel.type = type; - testModel.timerState = timerState; - testModel.timestamp = timestamp; - - if (expected) { - expect(RestartTimerAction.appliesTo(testContext)).toBeTruthy() - } else { - expect(RestartTimerAction.appliesTo(testContext)).toBeFalsy() - } - } }); } ); diff --git a/platform/features/clock/test/actions/StartTimerActionSpec.js b/platform/features/clock/test/actions/StartTimerActionSpec.js index a7a34f2043..1506c79738 100644 --- a/platform/features/clock/test/actions/StartTimerActionSpec.js +++ b/platform/features/clock/test/actions/StartTimerActionSpec.js @@ -39,6 +39,18 @@ define( }; } + function testState(type, timerState, timestamp, expected) { + testModel.type = type; + testModel.timerState = timerState; + testModel.timestamp = timestamp; + + if (expected) { + expect(StartTimerAction.appliesTo(testContext)).toBeTruthy(); + } else { + expect(StartTimerAction.appliesTo(testContext)).toBeFalsy(); + } + } + beforeEach(function () { mockNow = jasmine.createSpy('now'); mockDomainObject = jasmine.createSpyObj( @@ -93,18 +105,6 @@ define( //not a timer testState('clock', 'paused', 12000, false); }); - - function testState(type, timerState, timestamp, expected) { - testModel.type = type; - testModel.timerState = timerState; - testModel.timestamp = timestamp; - - if (expected) { - expect(StartTimerAction.appliesTo(testContext)).toBeTruthy() - } else { - expect(StartTimerAction.appliesTo(testContext)).toBeFalsy() - } - } }); } ); diff --git a/platform/features/clock/test/actions/StopTimerActionSpec.js b/platform/features/clock/test/actions/StopTimerActionSpec.js index e54d7ca514..a4c27ad921 100644 --- a/platform/features/clock/test/actions/StopTimerActionSpec.js +++ b/platform/features/clock/test/actions/StopTimerActionSpec.js @@ -39,6 +39,18 @@ define( }; } + function testState(type, timerState, timestamp, expected) { + testModel.type = type; + testModel.timerState = timerState; + testModel.timestamp = timestamp; + + if (expected) { + expect(StopTimerAction.appliesTo(testContext)).toBeTruthy(); + } else { + expect(StopTimerAction.appliesTo(testContext)).toBeFalsy(); + } + } + beforeEach(function () { mockNow = jasmine.createSpy('now'); mockDomainObject = jasmine.createSpyObj( @@ -93,18 +105,6 @@ define( //not a timer testState('clock', 'paused', 12000, false); }); - - function testState(type, timerState, timestamp, expected) { - testModel.type = type; - testModel.timerState = timerState; - testModel.timestamp = timestamp; - - if (expected) { - expect(StopTimerAction.appliesTo(testContext)).toBeTruthy() - } else { - expect(StopTimerAction.appliesTo(testContext)).toBeFalsy() - } - } }); } );