diff options
author | John Resig <jeresig@gmail.com> | 2011-04-16 17:39:30 -0700 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2011-04-16 17:39:30 -0700 |
commit | 5d70c6d797af15641a8e562cf5b3d022a1bdda25 (patch) | |
tree | d0b7858eac38d33398d98e7a9675ce19a520cc32 /test | |
parent | 6e3b596514d20124260bc4b3febd8dc105420626 (diff) | |
download | jquery-5d70c6d797af15641a8e562cf5b3d022a1bdda25.tar.gz jquery-5d70c6d797af15641a8e562cf5b3d022a1bdda25.zip |
Add in unit tests for #6993.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/event.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 1710f6f98..a1aee191f 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -15,7 +15,7 @@ test("null or undefined handler", function() { }); test("bind(), with data", function() { - expect(3); + expect(4); var handler = function(event) { ok( event.data, "bind() with data, check passed data exists" ); equals( event.data.foo, "bar", "bind() with data, Check value of passed data" ); @@ -23,6 +23,12 @@ test("bind(), with data", function() { jQuery("#firstp").bind("click", {foo: "bar"}, handler).click().unbind("click", handler); ok( !jQuery._data(jQuery("#firstp")[0], "events"), "Event handler unbound when using data." ); + + var test = function(){}; + var handler2 = function(event) { + equals( event.data, test, "bind() with function data, Check value of passed data" ); + }; + jQuery("#firstp").bind("click", test, handler2).click().unbind("click", handler2); }); test("click(), with data", function() { |