X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=test%2Funit%2Fevent.js;h=e12f3b753c9e8be5cec65e5b2abfd861b1a0c51a;hb=ec7baf230d3c246dadf00c94115e6668425b9354;hp=cbeb9ff0011c9f59650c4b1c653b4a14bb9094db;hpb=d12e8a34e6d96f98ac4f9408a0d61a9ed373f917;p=jquery.git diff --git a/test/unit/event.js b/test/unit/event.js index cbeb9ff..e12f3b7 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -474,7 +474,7 @@ test("toggle(Function, Function, ...)", function() { }); test(".live()/.die()", function() { - expect(34); + expect(36); var submit = 0, div = 0, livea = 0, liveb = 0; @@ -571,10 +571,23 @@ test(".live()/.die()", function() { equals( called, 3, "Verify that only one click occurred." ); jQuery("#anchor2").trigger("click"); - equals( called, 3, "Verify that only one click occurred." ); + equals( called, 3, "Verify that no click occurred." ); + + // Make sure that it still works if the selector is the same, + // but the event type is different + jQuery("#nothiddendiv").live("foo", callback); // Cleanup jQuery("#nothiddendiv").die("click", callback); + + jQuery("#nothiddendiv").trigger("click"); + equals( called, 3, "Verify that no click occurred." ); + + jQuery("#nothiddendiv").trigger("foo"); + equals( called, 4, "Verify that one foo occurred." ); + + // Cleanup + jQuery("#nothiddendiv").die("foo", callback); }); /*