Skip to content

Commit a6b0705

Browse files
committed
Tests: add test for passing trigger data to radio click handler
Close jquerygh-3581 Fixes jquerygh-3579
1 parent 35785a3 commit a6b0705

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/unit/event.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,6 +2915,16 @@ QUnit.test( "originalEvent property for Chrome, Safari, Fx & Edge of simulated e
29152915
outer.off( "focusin" );
29162916
} );
29172917

2918+
QUnit.test( "trigger('click') on radio passes extra params", function( assert ) {
2919+
assert.expect( 1 );
2920+
var $radio = jQuery( "<input type='radio' />" ).appendTo( "#qunit-fixture" )
2921+
.on( "click", function( e, data ) {
2922+
assert.ok( data, "Trigger data is passed to radio click handler" );
2923+
} );
2924+
2925+
$radio.trigger( "click", [ true ] );
2926+
} );
2927+
29182928
QUnit[ jQuery.fn.click ? "test" : "skip" ]( "trigger() shortcuts", function( assert ) {
29192929
assert.expect( 5 );
29202930

0 commit comments

Comments
 (0)