aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/event.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2016-06-02 18:33:47 -0400
committerDave Methvin <dave.methvin@gmail.com>2016-06-02 20:56:47 -0400
commit2df590e4ecfb8874b1deaca26d3c4cc2b7f7b140 (patch)
tree9855287c2d0612312a3ece6c507821f32c33f81c /test/unit/event.js
parent73bf35ecf31867d7ed4662374121efa310cf9f8d (diff)
downloadjquery-2df590e4ecfb8874b1deaca26d3c4cc2b7f7b140.tar.gz
jquery-2df590e4ecfb8874b1deaca26d3c4cc2b7f7b140.zip
Event: Allow constructing a jQuery.Event without a target
Fixes gh-3139 Closes gh-3140
Diffstat (limited to 'test/unit/event.js')
-rw-r--r--test/unit/event.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index 99797061f..fef3b173e 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -2736,6 +2736,15 @@ QUnit.test( ".off() removes the expando when there's no more data", function( as
}
} );
+QUnit.test( "jQuery.Event( src ) does not require a target property", function( assert ) {
+ assert.expect( 2 );
+
+ var event = jQuery.Event( { type: "offtarget" } );
+
+ assert.equal( event.type, "offtarget", "correct type" );
+ assert.equal( event.target, undefined, "no target" );
+} );
+
QUnit.test( "preventDefault() on focusin does not throw exception", function( assert ) {
assert.expect( 1 );