@@ -24,16 +24,11 @@ test("jQuery.attrFix/jQuery.propFix integrity test", function() {
2424 usemap : "useMap" ,
2525 frameborder : "frameBorder" ,
2626 contenteditable : "contentEditable"
27- } ,
28- propsShouldBe ;
29-
30- if ( ! jQuery . support . getSetAttribute ) {
31- propsShouldBe = props ;
32- } else {
33- propsShouldBe = {
34- tabindex : "tabIndex"
3527 } ;
36- }
28+
29+ var propsShouldBe = {
30+ tabindex : "tabIndex"
31+ } ;
3732
3833 deepEqual ( propsShouldBe , jQuery . attrFix , "jQuery.attrFix passes integrity check" ) ;
3934 deepEqual ( props , jQuery . propFix , "jQuery.propFix passes integrity check" ) ;
@@ -162,7 +157,7 @@ test("attr(Hash)", function() {
162157} ) ;
163158
164159test ( "attr(String, Object)" , function ( ) {
165- expect ( 73 ) ;
160+ expect ( 75 ) ;
166161
167162 var div = jQuery ( "div" ) . attr ( "foo" , "bar" ) ,
168163 fail = false ;
@@ -244,9 +239,13 @@ test("attr(String, Object)", function() {
244239 equal ( $details . attr ( "open" ) , "open" , "open attribute presense indicates true" ) ;
245240 equal ( $details . attr ( "open" , false ) . attr ( "open" ) , undefined , "Setting open attribute to false removes it" ) ;
246241
247- equals ( $text . attr ( "data-something" , true ) . data ( "something" ) , true , "Setting data attributes are not affected by boolean settings" ) ;
248- equals ( $text . attr ( "data-another" , false ) . data ( "another" ) , false , "Setting data attributes are not affected by boolean settings" ) ;
249- equals ( $text . attr ( "aria-disabled" , false ) . attr ( "aria-disabled" ) , "false" , "Setting aria attributes are not affected by boolean settings" ) ;
242+ $text . attr ( "data-something" , true ) ;
243+ equal ( $text . attr ( "data-something" ) , "true" , "Set data attributes" ) ;
244+ equal ( $text . data ( "something" ) , true , "Setting data attributes are not affected by boolean settings" ) ;
245+ $text . attr ( "data-another" , false ) ;
246+ equal ( $text . attr ( "data-another" ) , "false" , "Set data attributes" ) ;
247+ equal ( $text . data ( "another" ) , false , "Setting data attributes are not affected by boolean settings" ) ;
248+ equal ( $text . attr ( "aria-disabled" , false ) . attr ( "aria-disabled" ) , "false" , "Setting aria attributes are not affected by boolean settings" ) ;
250249 $text . removeData ( "something" ) . removeData ( "another" ) . removeAttr ( "aria-disabled" ) ;
251250
252251 jQuery ( "#foo" ) . attr ( "contenteditable" , true ) ;
@@ -1032,43 +1031,43 @@ test("toggleClass(Fucntion[, boolean]) with incoming value", function() {
10321031 ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
10331032
10341033 e . toggleClass ( function ( i , val ) {
1035- equals ( val , old , "Make sure the incoming value is correct." ) ;
1034+ equal ( old , val , "Make sure the incoming value is correct." ) ;
10361035 return "test" ;
10371036 } ) ;
10381037 ok ( e . is ( ".test" ) , "Assert class present" ) ;
10391038
10401039 old = e . attr ( "class" ) ;
10411040
10421041 e . toggleClass ( function ( i , val ) {
1043- equals ( val , old , "Make sure the incoming value is correct." ) ;
1042+ equal ( old , val , "Make sure the incoming value is correct." ) ;
10441043 return "test" ;
10451044 } ) ;
10461045 ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
10471046
1048- old = e . attr ( "class" ) ;
1047+ old = e . attr ( "class" ) || "" ;
10491048
10501049 // class name with a boolean
10511050 e . toggleClass ( function ( i , val , state ) {
1052- equals ( val , old , "Make sure the incoming value is correct." ) ;
1053- equals ( state , false , "Make sure that the state is passed in." ) ;
1051+ equal ( old , val , "Make sure the incoming value is correct." ) ;
1052+ equal ( state , false , "Make sure that the state is passed in." ) ;
10541053 return "test" ;
10551054 } , false ) ;
10561055 ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
10571056
1058- old = e . attr ( "class" ) ;
1057+ old = e . attr ( "class" ) || "" ;
10591058
10601059 e . toggleClass ( function ( i , val , state ) {
1061- equals ( val , old , "Make sure the incoming value is correct." ) ;
1062- equals ( state , true , "Make sure that the state is passed in." ) ;
1060+ equal ( old , val , "Make sure the incoming value is correct." ) ;
1061+ equal ( state , true , "Make sure that the state is passed in." ) ;
10631062 return "test" ;
10641063 } , true ) ;
10651064 ok ( e . is ( ".test" ) , "Assert class present" ) ;
10661065
10671066 old = e . attr ( "class" ) ;
10681067
10691068 e . toggleClass ( function ( i , val , state ) {
1070- equals ( val , old , "Make sure the incoming value is correct." ) ;
1071- equals ( state , false , "Make sure that the state is passed in." ) ;
1069+ equal ( old , val , "Make sure the incoming value is correct." ) ;
1070+ equal ( state , false , "Make sure that the state is passed in." ) ;
10721071 return "test" ;
10731072 } , false ) ;
10741073 ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
0 commit comments