X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fevent.js;h=d10b3d3727aced1a803efb7fb44ff3002435b62e;hb=bca82254137a161094377b2d8189c2d9d5906a0f;hp=cc84786482a3af22f0977a6187fd24b98326d009;hpb=ee34b6982ab25cd7699f68506d7b18a02c3c4d44;p=jquery.git diff --git a/test/unit/event.js b/test/unit/event.js index cc84786..d10b3d3 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -745,6 +745,36 @@ test(".live()/.die()", function() { jQuery('span#liveSpan1').die('click'); }); +test("live with focus/blur", function(){ + expect(2); + + // Setup + jQuery("").appendTo("body"); + + var $child = jQuery("#livefb"), + child = $child[0], + counter = 0; + + function count(){ + counter++; + } + + // Test + $child.live("focus", count); + $child.live("blur", count); + + child.focus(); + equals(counter, 1, "Test live() with focus event"); + + child.blur(); + equals(counter, 2, "Test live() with blur event"); + + // Teardown + $child.die("focus", count); + $child.die("blur", count); + $child.remove(); +}); + test("Non DOM element events", function() { expect(3);