Skip to content

Commit e91a2f3

Browse files
authored
Merge pull request #5862 from mportuga/features/customScrollerTests
test(scroller): Updating unit tests to stop full mock.
2 parents ee8a3cb + 4fd3648 commit e91a2f3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,19 @@ describe('ui.grid.customScrolling', function() {
1313
off: jasmine.createSpy('off')
1414
};
1515
scrollHandler = jasmine.createSpy('scrollHandler');
16-
gridUtil = jasmine.createSpyObj('gridUtil', ['isTouchEnabled']);
1716

18-
module('ui.grid.customScrolling', function($provide) {
19-
$provide.value('gridUtil', gridUtil);
20-
});
17+
module('ui.grid.customScrolling');
2118

22-
inject(function(_uiGridScroller_, _uiGridScrollerConstants_) {
19+
inject(function(_uiGridScroller_, _uiGridScrollerConstants_, _gridUtil_) {
2320
uiGridScroller = _uiGridScroller_;
2421
uiGridScrollerConstants = _uiGridScrollerConstants_;
22+
gridUtil = _gridUtil_;
2523
});
2624
});
2725

2826
describe('when gridUtils.isTouchEnabled returns true', function() {
2927
beforeEach(function() {
30-
gridUtil.isTouchEnabled.and.returnValue(true);
28+
spyOn(gridUtil, 'isTouchEnabled').and.returnValue(true);
3129
uiGridScroller(element, scrollHandler);
3230
});
3331
it('should initialize uiGridScroller.initiated to NONE', function() {
@@ -170,7 +168,7 @@ describe('ui.grid.customScrolling', function() {
170168

171169
describe('when gridUtils.isTouchEnabled returns false', function() {
172170
beforeEach(function() {
173-
gridUtil.isTouchEnabled.and.returnValue(false);
171+
spyOn(gridUtil, 'isTouchEnabled').and.returnValue(false);
174172
uiGridScroller(element, scrollHandler);
175173
});
176174
it('should initialize uiGridScroller.initiated to NONE', function() {

0 commit comments

Comments
 (0)