Skip to content

Commit a72fcb4

Browse files
author
ychartois
committed
Update timer.js
Workaround to allow e2e tests ,we can't use $timout which make the e2e to hang.
1 parent 679aea4 commit a72fcb4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/js/timer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ angular.module('timer', [])
7474
$scope.seconds = Math.floor(($scope.millis / 1000) % 60);
7575
$scope.minutes = Math.floor((($scope.millis / (1000 * 60)) % 60));
7676
$scope.hours = Math.floor((($scope.millis / (1000 * 60 * 60)) % 24));
77-
$scope.timeoutId = $timeout(function () {
77+
// Workaround to allow e2e tests ,we can't use $timout which make the
78+
// e2e to hang
79+
$scope.timeoutId = setTimeout(function() {
7880
tick();
81+
$scope.$apply();
7982
}, $scope.interval);
8083

8184
$scope.$emit('timer-tick', {timeoutId: $scope.timeoutId, millis: $scope.millis});

0 commit comments

Comments
 (0)