Changed the currentTarget test - no need to test the native event triggering for...
[jquery.git] / test / unit / event.js
index 1da9b59..2ba2561 100644 (file)
@@ -417,6 +417,21 @@ test("trigger(eventObject, [data], [fn])", function() {
        $parent.unbind().remove();
 });
 
+test("jQuery.Event.currentTarget", function(){
+       expect(1);
+       
+       var counter = 0,
+               $elem = jQuery('<button>a</button>').click(function(e){
+               equals( e.currentTarget, this, "Check currentTarget on "+(counter++?"native":"fake") +" event" );
+       });
+       
+       // Fake event
+       $elem.trigger('click');
+       
+       // Cleanup
+       $elem.unbind();
+});
+
 test("toggle(Function, Function, ...)", function() {
        expect(11);