X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fevent.js;h=43a4542f0c427627bc88500cfadc32a8fbd22c5e;hb=3261544c38ca70cc02c5eed7d0ab2c40c521a588;hp=610448145ca0e5280d9bad2af0391e824653cc8a;hpb=70ae356e4ed1f74bb008939b345437fbe7deb26d;p=jquery.git diff --git a/test/unit/event.js b/test/unit/event.js index 6104481..43a4542 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1,7 +1,7 @@ module("event"); test("bind()", function() { - expect(18); + expect(19); var handler = function(event) { ok( event.data, "bind() with data, check passed data exists" ); @@ -85,6 +85,11 @@ test("bind()", function() { $("#nonnodes").contents().bind("tester", function () { equals(this.nodeType, 1, "Check node,textnode,comment bind just does real nodes" ); }).trigger("tester"); + + // Make sure events stick with appendTo'd elements (which are cloned) #2027 + $("test").click(function(){ return false; }).appendTo("p"); + ok( $("a.test:first").triggerHandler("click") === false, "Handler is bound to appendTo'd elements" ); + reset(); }); test("click()", function() { @@ -217,6 +222,7 @@ test("trigger(event, [data], [fn])", function() { // Trigger only the handlers (no native) and extra fn, with external event obj // Triggers 9 + eventObj = jQuery.event.fix({ type: "foo", target: document.body }); equals( $("#firstp").triggerHandler("click", [eventObj, 1, "2", "abc"], handler), "test", "Verify handler response" ); var pass = true; @@ -270,4 +276,4 @@ test("jQuery(function($) {})", function() { equals(jQuery, $, "ready doesn't provide an event object, instead it provides a reference to the jQuery function, see http://docs.jquery.com/Events/ready#fn"); start(); }); -}); \ No newline at end of file +});