diff options
author | rwldrn <waldron.rick@gmail.com> | 2010-10-24 12:18:33 -0400 |
---|---|---|
committer | rwldrn <waldron.rick@gmail.com> | 2010-10-24 12:18:33 -0400 |
commit | 3b50eaca2cd0b1439235e39c4e98a6438e8f55b2 (patch) | |
tree | 6f12ed09790df3d99001d43f8f9e1a514da30452 /test | |
parent | 9bd9ebdd73fe0e2d29fadf82947c98adde4023e7 (diff) | |
download | jquery-3b50eaca2cd0b1439235e39c4e98a6438e8f55b2.tar.gz jquery-3b50eaca2cd0b1439235e39c4e98a6438e8f55b2.zip |
Fixes #7229 and #5803
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/ajax.js | 15 | ||||
-rw-r--r-- | test/unit/event.js | 20 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 5704d73e0..14c621826 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -799,6 +799,21 @@ test("jQuery.ajax() - JSONP, Local", function() { plus(); } }); + + // Supports Ticket #5803 + jQuery.ajax({ + url: "data/jsonp.php", + jsonpCallback: "jsonpResults", + success: function(data){ + ok( data.data, "JSON results returned without dataType:jsonp when jsonpCallback is defined" ); + plus(); + }, + error: function(data){ + ok( false, "Ajax error JSON (GET, custom callback name)" ); + plus(); + } + }); + }); test("JSONP - Custom JSONP Callback", function() { diff --git a/test/unit/event.js b/test/unit/event.js index f3d314884..5efa0ec51 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1,5 +1,25 @@ module("event"); +test("null or undefined handler", function() { + expect(2); + // Supports Fixes bug #7229 + try { + + jQuery("#firstp").click(null); + + ok(true, "Passing a null handler will not throw an exception"); + + } catch (e) {} + + try { + + jQuery("#firstp").click(undefined); + + ok(true, "Passing an undefined handler will not throw an exception"); + + } catch (e) {} +}); + test("bind(), with data", function() { expect(3); var handler = function(event) { |