Skip to content

Commit b44dd33

Browse files
committed
test/BasicSetupSpec.js: Replace deprecrated .bind() and .unbind() with .on() and .off() respectively.
* https://api.jquery.com/category/deprecated/deprecated-3.0/
1 parent a905ee9 commit b44dd33

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/BasicSetupSpec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ describe('uiScroll', function() {
2222
spyOn($.fn, 'unbind').and.callThrough();
2323
runTest(scrollSettings,
2424
function(viewport) {
25-
expect($.fn.bind.calls.all().length).toBe(3);
26-
expect($.fn.bind.calls.all()[0].args[0]).toBe('mousewheel');
27-
expect($.fn.bind.calls.all()[0].object[0]).toBe(viewport[0]);
28-
expect($.fn.bind.calls.all()[1].args[0]).toBe('resize');
29-
expect($.fn.bind.calls.all()[1].object[0]).toBe(viewport[0]);
30-
expect($.fn.bind.calls.all()[2].args[0]).toBe('scroll');
31-
expect($.fn.bind.calls.all()[2].object[0]).toBe(viewport[0]);
25+
expect($.fn.on.calls.all().length).toBe(3);
26+
expect($.fn.on.calls.all()[0].args[0]).toBe('mousewheel');
27+
expect($.fn.on.calls.all()[0].object[0]).toBe(viewport[0]);
28+
expect($.fn.on.calls.all()[1].args[0]).toBe('resize');
29+
expect($.fn.on.calls.all()[1].object[0]).toBe(viewport[0]);
30+
expect($.fn.on.calls.all()[2].args[0]).toBe('scroll');
31+
expect($.fn.on.calls.all()[2].object[0]).toBe(viewport[0]);
3232
}, {
3333
cleanupTest: function(viewport, scope, $timeout) {
3434
$timeout(function() {
35-
expect($.fn.unbind.calls.all().length).toBe(3);
36-
expect($.fn.unbind.calls.all()[0].args[0]).toBe('resize');
37-
expect($.fn.unbind.calls.all()[0].object[0]).toBe(viewport[0]);
38-
expect($.fn.unbind.calls.all()[1].args[0]).toBe('scroll');
39-
expect($.fn.unbind.calls.all()[1].object[0]).toBe(viewport[0]);
40-
expect($.fn.unbind.calls.all()[2].args[0]).toBe('mousewheel');
41-
expect($.fn.unbind.calls.all()[2].object[0]).toBe(viewport[0]);
35+
expect($.fn.off.calls.all().length).toBe(3);
36+
expect($.fn.off.calls.all()[0].args[0]).toBe('resize');
37+
expect($.fn.off.calls.all()[0].object[0]).toBe(viewport[0]);
38+
expect($.fn.off.calls.all()[1].args[0]).toBe('scroll');
39+
expect($.fn.off.calls.all()[1].object[0]).toBe(viewport[0]);
40+
expect($.fn.off.calls.all()[2].args[0]).toBe('mousewheel');
41+
expect($.fn.off.calls.all()[2].object[0]).toBe(viewport[0]);
4242
});
4343
}
4444
}

0 commit comments

Comments
 (0)