@@ -24,16 +24,11 @@ test("jQuery.attrFix/jQuery.propFix integrity test", function() {
24
24
usemap : "useMap" ,
25
25
frameborder : "frameBorder" ,
26
26
contenteditable : "contentEditable"
27
- } ,
28
- propsShouldBe ;
29
-
30
- if ( ! jQuery . support . getSetAttribute ) {
31
- propsShouldBe = props ;
32
- } else {
33
- propsShouldBe = {
34
- tabindex : "tabIndex"
35
27
} ;
36
- }
28
+
29
+ var propsShouldBe = {
30
+ tabindex : "tabIndex"
31
+ } ;
37
32
38
33
deepEqual ( propsShouldBe , jQuery . attrFix , "jQuery.attrFix passes integrity check" ) ;
39
34
deepEqual ( props , jQuery . propFix , "jQuery.propFix passes integrity check" ) ;
@@ -162,7 +157,7 @@ test("attr(Hash)", function() {
162
157
} ) ;
163
158
164
159
test ( "attr(String, Object)" , function ( ) {
165
- expect ( 73 ) ;
160
+ expect ( 75 ) ;
166
161
167
162
var div = jQuery ( "div" ) . attr ( "foo" , "bar" ) ,
168
163
fail = false ;
@@ -244,9 +239,13 @@ test("attr(String, Object)", function() {
244
239
equal ( $details . attr ( "open" ) , "open" , "open attribute presense indicates true" ) ;
245
240
equal ( $details . attr ( "open" , false ) . attr ( "open" ) , undefined , "Setting open attribute to false removes it" ) ;
246
241
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" ) ;
250
249
$text . removeData ( "something" ) . removeData ( "another" ) . removeAttr ( "aria-disabled" ) ;
251
250
252
251
jQuery ( "#foo" ) . attr ( "contenteditable" , true ) ;
@@ -1032,43 +1031,43 @@ test("toggleClass(Fucntion[, boolean]) with incoming value", function() {
1032
1031
ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
1033
1032
1034
1033
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." ) ;
1036
1035
return "test" ;
1037
1036
} ) ;
1038
1037
ok ( e . is ( ".test" ) , "Assert class present" ) ;
1039
1038
1040
1039
old = e . attr ( "class" ) ;
1041
1040
1042
1041
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." ) ;
1044
1043
return "test" ;
1045
1044
} ) ;
1046
1045
ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
1047
1046
1048
- old = e . attr ( "class" ) ;
1047
+ old = e . attr ( "class" ) || "" ;
1049
1048
1050
1049
// class name with a boolean
1051
1050
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." ) ;
1054
1053
return "test" ;
1055
1054
} , false ) ;
1056
1055
ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
1057
1056
1058
- old = e . attr ( "class" ) ;
1057
+ old = e . attr ( "class" ) || "" ;
1059
1058
1060
1059
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." ) ;
1063
1062
return "test" ;
1064
1063
} , true ) ;
1065
1064
ok ( e . is ( ".test" ) , "Assert class present" ) ;
1066
1065
1067
1066
old = e . attr ( "class" ) ;
1068
1067
1069
1068
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." ) ;
1072
1071
return "test" ;
1073
1072
} , false ) ;
1074
1073
ok ( ! e . is ( ".test" ) , "Assert class not present" ) ;
0 commit comments