From 4f5dfbc362d9683177708ebcc00c98cf594d1287 Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Wed, 7 Aug 2013 21:55:44 -0700 Subject: fix(jqLite): throw when jqLite#off called with 4 args Closes #3501 --- test/jqLiteSpec.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index ab98a70f..f8d71bc9 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -901,7 +901,7 @@ describe('jqLite', function() { }); - describe('unbind', function() { + describe('off', function() { it('should do nothing when no listener was registered with bound', function() { var aElem = jqLite(a); @@ -1051,6 +1051,17 @@ describe('jqLite', function() { expect(masterSpy).not.toHaveBeenCalled(); expect(extraSpy).toHaveBeenCalledOnce(); }); + + // Only run this test for jqLite and not normal jQuery + if ( _jqLiteMode ) { + it('should throw an error if a selector is passed', function () { + var aElem = jqLite(a); + aElem.on('click', noop); + expect(function () { + aElem.off('click', noop, '.test'); + }).toThrowMatching(/\[jqLite:off_args\]/); + }); + } }); -- cgit v1.2.3