diff options
author | jeresig <jeresig@gmail.com> | 2011-04-10 16:28:15 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2011-04-10 16:28:15 -0400 |
commit | 2c74ee46ee6c9a08fb42e105281f59c582a26e7d (patch) | |
tree | 9a506bb5dc1196bff66db49c36dc96758b7ebaf7 /test/unit | |
parent | 7fb95ebe8f1b79220947d127a5d2b8bf56143622 (diff) | |
parent | 92a4d59c3221ada339177ca860570893766a6429 (diff) | |
download | jquery-2c74ee46ee6c9a08fb42e105281f59c582a26e7d.tar.gz jquery-2c74ee46ee6c9a08fb42e105281f59c582a26e7d.zip |
Merge branch 'eventprops.1.6final' of https://github.com/rwldrn/jquery into rwldrn-eventprops.1.6final
Conflicts:
test/unit/event.js
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/event.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 50bf4e174..cefdf5833 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -975,6 +975,27 @@ test("trigger(eventObject, [data], [fn])", function() { $parent.unbind().remove(); }); +test("jQuery.Event({ /* props */ })", function() { + + expect(4); + + var event = jQuery.Event({ type: "keydown", keyCode: 64 }), + handler = function( event ) { + ok( "keyCode" in event, "Special property 'keyCode' exists" ); + equal( event.keyCode, 64, "event.keyCode has explicit value '64'" ); + }; + + // Supports jQuery.Event implementation + equal( event.type, "keydown", "Verify type" ); + + ok( "keyCode" in event, "Special 'keyCode' property exists" ); + + jQuery("body").bind( "keydown", handler ).trigger( event ); + + jQuery("body").unbind( "keydown" ); + +}); + test("jQuery.Event.currentTarget", function(){ expect(1); @@ -2151,3 +2172,4 @@ test("event properties", function() { }).click(); }); */ + |