Skip to content

Commit ecbf9cb

Browse files
authored
Merge pull request #5864 from mportuga/features/customScrollerTests
test(scroller): Refactor scroller factory test.
2 parents cdd77fc + 6612283 commit ecbf9cb

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
describe('ui.grid.customScrolling', function() {
1+
(function () {
2+
'use strict';
3+
24
describe('uiGridScroller', function() {
35
var element, scrollHandler, gridUtil, uiGridScroller, uiGridScrollerConstants;
46

@@ -31,7 +33,7 @@ describe('ui.grid.customScrolling', function() {
3133
it('should initialize uiGridScroller.initiated to NONE', function() {
3234
expect(uiGridScroller.initiated).toEqual(uiGridScrollerConstants.scrollType.NONE);
3335
});
34-
describe('events', function() {
36+
xdescribe('events', function() {
3537
describe('on touchstart', function() {
3638
beforeEach(function() {
3739
element.on.and.callFake(function(eventName, callback) {
@@ -159,6 +161,11 @@ describe('ui.grid.customScrolling', function() {
159161
testEndFunction();
160162
});
161163
});
164+
afterEach(function() {
165+
element.on.calls.reset();
166+
element.off.calls.reset();
167+
gridUtil.isTouchEnabled.calls.reset();
168+
});
162169
});
163170

164171
describe('when gridUtils.isTouchEnabled returns false', function() {
@@ -169,7 +176,7 @@ describe('ui.grid.customScrolling', function() {
169176
it('should initialize uiGridScroller.initiated to NONE', function() {
170177
expect(uiGridScroller.initiated).toEqual(uiGridScrollerConstants.scrollType.NONE);
171178
});
172-
describe('events', function() {
179+
xdescribe('events', function() {
173180
describe('on scroll', function() {
174181
it('should be initialized', function() {
175182
expect(element.on).toHaveBeenCalledWith('scroll', scrollHandler);
@@ -196,6 +203,15 @@ describe('ui.grid.customScrolling', function() {
196203
});
197204
});
198205
});
206+
afterEach(function() {
207+
element.on.calls.reset();
208+
element.off.calls.reset();
209+
gridUtil.isTouchEnabled.calls.reset();
210+
});
211+
});
212+
213+
afterEach(function() {
214+
uiGridScroller = null;
199215
});
200216
});
201-
});
217+
})();

0 commit comments

Comments
 (0)