aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimmy Willison <4timmywil@gmail.com>2017-03-20 12:54:38 -0400
committerTimmy Willison <4timmywil@gmail.com>2017-03-20 13:12:43 -0400
commita6b0705294d336ae2f63f7276de0da1195495363 (patch)
tree8c3df45cf35dae1c16693d916fc74a0c56a4ed08
parent35785a32298d1033933ea4b041adb4cc73eaae47 (diff)
downloadjquery-a6b0705294d336ae2f63f7276de0da1195495363.tar.gz
jquery-a6b0705294d336ae2f63f7276de0da1195495363.zip
Tests: add test for passing trigger data to radio click handler
Close gh-3581 Fixes gh-3579
-rw-r--r--test/unit/event.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index 02aad5e36..0c379d051 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -2915,6 +2915,16 @@ QUnit.test( "originalEvent property for Chrome, Safari, Fx & Edge of simulated e
outer.off( "focusin" );
} );
+QUnit.test( "trigger('click') on radio passes extra params", function( assert ) {
+ assert.expect( 1 );
+ var $radio = jQuery( "<input type='radio' />" ).appendTo( "#qunit-fixture" )
+ .on( "click", function( e, data ) {
+ assert.ok( data, "Trigger data is passed to radio click handler" );
+ } );
+
+ $radio.trigger( "click", [ true ] );
+} );
+
QUnit[ jQuery.fn.click ? "test" : "skip" ]( "trigger() shortcuts", function( assert ) {
assert.expect( 5 );