Add tests

This commit is contained in:
Rashid Khan 2015-05-08 16:43:17 -07:00
parent 3d900ecf18
commit 77314c60d6
2 changed files with 16 additions and 1 deletions

View file

@ -137,7 +137,7 @@ define(function (require) {
};
$scope.setRefreshInterval = function (interval) {
interval.pause = false;
interval.pause = interval.pause == null ? false : true;
$scope.interval = interval;
};

View file

@ -111,6 +111,21 @@ define(function (require) {
done();
});
it('should disable the looper when paused', function (done) {
$scope.setRefreshInterval({ value : 1000, pause: true});
$elem.scope().$digest();
expect($courier.searchLooper.loopInterval()).to.be(0);
expect($scope.interval.value).to.be(1000);
done();
});
it('but keep interval.value set', function (done) {
$scope.setRefreshInterval({ value : 1000, pause: true});
$elem.scope().$digest();
expect($scope.interval.value).to.be(1000);
done();
});
it('should highlight the current active interval', function (done) {
$scope.setRefreshInterval({ value: 300000 });
$elem.scope().$digest();