X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=test%2Funit%2Fevent.js;h=7d66c9ca2116ca9992eb8b7d04413160f354cb26;hb=da966573c3f3cb083c48cd3ead88e7542937d4df;hp=33329c3117bb7832ce9182fd01694b59b09a73f5;hpb=021b809acecc4e94613375b3182c86722470fe9b;p=jquery.git diff --git a/test/unit/event.js b/test/unit/event.js index 33329c3..7d66c9c 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -72,7 +72,7 @@ test("bind(), multiple events at once and namespaces", function() { }); test("bind(), namespace with special add", function() { - expect(19); + expect(24); var div = jQuery("
").bind("test", function(e) { ok( true, "Test event fired." ); @@ -97,7 +97,9 @@ test("bind(), namespace with special add", function() { handler.apply( this, arguments ); }; }, - remove: function() {} + remove: function() { + ok(true, "Remove called."); + } }; div.bind("test.a", {x: 1}, function(e) { @@ -119,7 +121,17 @@ test("bind(), namespace with special add", function() { // Should trigger 2 div.trigger("test.b"); + // Should trigger 4 div.unbind("test"); + + div = jQuery("
").bind("test", function(e) { + ok( true, "Test event fired." ); + }); + + // Should trigger 2 + div.appendTo("#main").remove(); + + delete jQuery.event.special.test; }); test("bind(), no data", function() { @@ -759,7 +771,7 @@ test("toggle(Function, Function, ...)", function() { }); test(".live()/.die()", function() { - expect(65); + expect(66); var submit = 0, div = 0, livea = 0, liveb = 0; @@ -1024,6 +1036,14 @@ test(".live()/.die()", function() { equals( livee, 1, "Click, deep selector." ); jQuery("#nothiddendiv div").die("click"); + + jQuery("#nothiddendiv div").live("blur", function(){ + ok( true, "Live div trigger blur." ); + }); + + jQuery("#nothiddendiv div").trigger("blur"); + + jQuery("#nothiddendiv div").die("blur"); }); test("die all bound events", function(){