ok( !jQuery.data(jQuery("#firstp")[0], "events"), "Event handler unbound when using data." );
});
+test("click(), with data", function() {
+ expect(3);
+ 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").click({foo: "bar"}, handler).click().unbind("click", handler);
+
+ ok( !jQuery.data(jQuery("#firstp")[0], "events"), "Event handler unbound when using data." );
+});
+
test("bind(), with data, trigger with data", function() {
expect(4);
var handler = function(event, data) {
ok( !jQuery.data(jQuery("#firstp")[0], "events"), "Event handler unbound when using different this object and data." );
});
+test("bind(name, false), unbind(name, false)", function() {
+ expect(3);
+
+ var main = 0;
+ jQuery("#main").bind("click", function(e){ main++; });
+ jQuery("#ap").trigger("click");
+ equals( main, 1, "Verify that the trigger happened correctly." );
+
+ main = 0;
+ jQuery("#ap").bind("click", false);
+ jQuery("#ap").trigger("click");
+ equals( main, 0, "Verify that no bubble happened." );
+
+ main = 0;
+ jQuery("#ap").unbind("click", false);
+ jQuery("#ap").trigger("click");
+ equals( main, 1, "Verify that the trigger happened correctly." );
+});
+
test("bind()/trigger()/unbind() on plain object", function() {
expect( 2 );