Skip to content

Commit 94dbf4d

Browse files
Ditommaso, Danielmportuga
authored andcommitted
test(Grid.spec.js): Updated mock for cross-browser compatibility
1 parent 403bf3e commit 94dbf4d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/unit/core/factories/Grid.spec.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ describe('Grid factory', function () {
127127
}
128128
});
129129
describe('scrollbarHeight and scrollbarWidth', function() {
130+
beforeEach(function() {
131+
spyOn(gridUtil, 'getScrollbarWidth').and.returnValue(100);
132+
});
133+
afterEach(function() {
134+
gridUtil.getScrollbarWidth.calls.reset();
135+
});
130136
describe('when enableHorizontalScrollbar not equal to NEVER', function() {
131137
it('should set scrollbarHeight and scrollbarWidth', function() {
132138
var grid = new Grid({
@@ -135,8 +141,8 @@ describe('Grid factory', function () {
135141
enableVerticalScrollbar: uiGridConstants.scrollbars.ALWAYS
136142
});
137143

138-
expect(grid.scrollbarHeight).not.toEqual(0);
139-
expect(grid.scrollbarWidth).not.toEqual(0);
144+
expect(grid.scrollbarHeight).toEqual(100);
145+
expect(grid.scrollbarWidth).toEqual(100);
140146
});
141147
});
142148
describe('when enableHorizontalScrollbar is equal to NEVER', function() {

0 commit comments

Comments
 (0)