Tests: add test for passing trigger data to radio click handler

Close gh-3581
Fixes gh-3579
This commit is contained in:
Timmy Willison 2017-03-20 12:54:38 -04:00
parent 35785a3229
commit a6b0705294
No known key found for this signature in database
GPG Key ID: 5F0C8B73EF56CE6F

View File

@ -2915,6 +2915,16 @@ QUnit.test( "originalEvent property for Chrome, Safari, Fx & Edge of simulated e
outer.off( "focusin" ); 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 ) { QUnit[ jQuery.fn.click ? "test" : "skip" ]( "trigger() shortcuts", function( assert ) {
assert.expect( 5 ); assert.expect( 5 );