Skip to content

Commit b2e4c8d

Browse files
Portugal, Marcelomportuga
authored andcommitted
test(ui-grid-custom-scroller.factory.js): Exposing tests for initializing events.
1 parent 2a55169 commit b2e4c8d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/features/custom-scrolling/test/ui-grid-custom-scroller.factory.spec.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@
3333
it('should initialize uiGridScroller.initiated to NONE', function() {
3434
expect(uiGridScroller.initiated).toEqual(uiGridScrollerConstants.scrollType.NONE);
3535
});
36+
it('should initialize touchstart', function() {
37+
expect(element.on).toHaveBeenCalledWith('touchstart', jasmine.any(Function));
38+
});
39+
it('should initialize touchmove', function() {
40+
expect(element.on).toHaveBeenCalledWith('touchmove', jasmine.any(Function));
41+
});
42+
it('should initialize touchend', function() {
43+
expect(element.on).toHaveBeenCalledWith('touchend', jasmine.any(Function));
44+
});
45+
it('should initialize touchcancel', function() {
46+
expect(element.on).toHaveBeenCalledWith('touchcancel', jasmine.any(Function));
47+
});
3648
xdescribe('events', function() {
3749
describe('on touchstart', function() {
3850
beforeEach(function() {
@@ -46,9 +58,6 @@
4658
});
4759
uiGridScroller(element, scrollHandler);
4860
});
49-
it('should be initialized', function() {
50-
expect(element.on).toHaveBeenCalledWith('touchstart', jasmine.any(Function));
51-
});
5261
it('should remove the scroll event from the element', function() {
5362
expect(element.off).toHaveBeenCalledWith('scroll', scrollHandler);
5463
});
@@ -74,9 +83,6 @@
7483
}
7584
});
7685
});
77-
it('should be initialized', function() {
78-
expect(element.on).toHaveBeenCalledWith('touchmove', jasmine.any(Function));
79-
});
8086
describe('when the uiGridScroller has been initiated with a touch event', function() {
8187
beforeEach(function() {
8288
uiGridScroller.initiated = uiGridScrollerConstants.scrollType.TOUCHABLE;
@@ -139,9 +145,6 @@
139145
}
140146
});
141147
});
142-
it('should be initialized', function() {
143-
expect(element.on).toHaveBeenCalledWith('touchend', jasmine.any(Function));
144-
});
145148
testEndFunction();
146149
});
147150
describe('on touchcancel', function() {

0 commit comments

Comments
 (0)