Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed May 8, 2015
1 parent 3d900ec commit 77314c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/kibana/components/timepicker/timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ define(function (require) {
};

$scope.setRefreshInterval = function (interval) {
interval.pause = false;
interval.pause = interval.pause == null ? false : true;
$scope.interval = interval;
};

Expand Down
15 changes: 15 additions & 0 deletions test/unit/specs/directives/timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 77314c6

Please sign in to comment.