@@ -2364,48 +2364,33 @@ QUnit.test( "clone() delegated events (#11076)", function( assert ) {
23642364 clone . remove ( ) ;
23652365} ) ;
23662366
2367- QUnit . test ( "checkbox state (#3827, gh-3423 )" , function ( assert ) {
2368- assert . expect ( 17 ) ;
2367+ QUnit . test ( "checkbox state (#3827)" , function ( assert ) {
2368+ assert . expect ( 9 ) ;
23692369
2370- var cbParent = jQuery ( "<div><input type=checkbox><div>" ) . appendTo ( "#qunit-fixture" ) ,
2371- cb = cbParent . find ( "input" ) [ 0 ] ,
2372- radioParent = jQuery (
2373- "<div><input type=radio name=gh3423><input type=radio name=gh3423><div>"
2374- ) . appendTo ( "#qunit-fixture" ) ,
2375- radio = radioParent . find ( "input" ) [ 0 ] ,
2376- radio2 = radioParent . find ( "input" ) [ 1 ] ;
2370+ var markup = jQuery ( "<div><input type=checkbox><div>" ) . appendTo ( "#qunit-fixture" ) ,
2371+ cb = markup . find ( "input" ) [ 0 ] ;
23772372
23782373 jQuery ( cb ) . on ( "click" , function ( ) {
23792374 assert . equal ( this . checked , false , "just-clicked checkbox is not checked" ) ;
23802375 } ) ;
2381- cbParent . on ( "click" , function ( ) {
2376+ markup . on ( "click" , function ( ) {
23822377 assert . equal ( cb . checked , false , "checkbox is not checked in bubbled event" ) ;
23832378 } ) ;
2384- radioParent . on ( "click" , function ( ) {
2385- assert . equal ( radio . checked , false , "radio is not checked in bubbled event" ) ;
2386- } ) ;
23872379
23882380 // Native click
2389- cb . checked = radio . checked = true ;
2381+ cb . checked = true ;
23902382 assert . equal ( cb . checked , true , "native - checkbox is initially checked" ) ;
2391- assert . equal ( radio . checked , true , "native - radio is initially checked" ) ;
23922383 cb . click ( ) ;
2393- radio2 . click ( ) ;
23942384 assert . equal ( cb . checked , false , "native - checkbox is no longer checked" ) ;
2395- assert . equal ( radio . checked , false , "native - radio is no longer checked" ) ;
23962385
23972386 // jQuery click
2398- cb . checked = radio . checked = true ;
2399- assert . equal ( cb . checked , true , ".trigger - checkbox is initially checked" ) ;
2400- assert . equal ( radio . checked , true , ".trigger - radio is initially checked" ) ;
2401- jQuery ( [ cb , radio2 ] ) . trigger ( "click" ) ;
2402- assert . equal ( cb . checked , false , ".trigger - checkbox is no longer checked" ) ;
2403- assert . equal ( radio . checked , false , ".trigger - radio is no longer checked" ) ;
2387+ cb . checked = true ;
2388+ assert . equal ( cb . checked , true , "jQuery - checkbox is initially checked" ) ;
2389+ jQuery ( cb ) . trigger ( "click" ) ;
2390+ assert . equal ( cb . checked , false , "jQuery - checkbox is no longer checked" ) ;
24042391
24052392 // Handlers only; checkbox state remains false
2406- jQuery ( [ cb , radio2 ] ) . triggerHandler ( "click" ) ;
2407- assert . equal ( cb . checked , false , ".triggerHandler - checkbox is still unchecked" ) ;
2408- assert . equal ( radio . checked , false , ".triggerHandler - radio is still unchecked" ) ;
2393+ jQuery ( cb ) . triggerHandler ( "click" ) ;
24092394} ) ;
24102395
24112396QUnit . test ( "hover event no longer special since 1.9" , function ( assert ) {
0 commit comments