Skip to content

Commit 921d109

Browse files
authored
test(ui-grid-custom-scrolling.directive): Adding missing tests for the directive. (#5860)
1 parent 3c6fcb4 commit 921d109

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
describe('ui.grid.customScrolling', function() {
2+
describe('uiGridCustomScrolling Directive', function() {
3+
var $compile, $rootScope, $scope, elm;
4+
5+
beforeEach(function() {
6+
module('ui.grid');
7+
module('ui.grid.customScrolling');
8+
9+
inject(function (_$rootScope_, _$compile_) {
10+
$rootScope = _$rootScope_;
11+
$compile = _$compile_;
12+
});
13+
14+
$scope = $rootScope.$new();
15+
$scope.gridOpts = {
16+
data: [{ name: 'Bob' }, {name: 'Mathias'}, {name: 'Fred'}]
17+
};
18+
19+
elm = angular.element('<div ui-grid="gridOpts" ui-grid-custom-scrolling></div>');
20+
21+
$compile(elm)($scope);
22+
$scope.$digest();
23+
});
24+
25+
it('should update the grid options to define a customScroller', function() {
26+
expect($scope.gridOpts.customScroller).toBeDefined();
27+
expect(angular.isFunction($scope.gridOpts.customScroller)).toBe(true);
28+
});
29+
});
30+
});

0 commit comments

Comments
 (0)