Skip to content
Permalink
Browse files

Add in unit tests for #6993.

  • Loading branch information...
jeresig committed Apr 17, 2011
1 parent 6e3b596 commit 5d70c6d797af15641a8e562cf5b3d022a1bdda25
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/unit/event.js
@@ -15,14 +15,20 @@ 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" );
};
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() {

0 comments on commit 5d70c6d

Please sign in to comment.
You can’t perform that action at this time.