@@ -67,6 +67,9 @@ function assertIcon( checkbox, icon, assert ) {
67
67
assert . hasClasses ( iconElement , "ui-checkboxradio-icon ui-corner-all ui-icon " +
68
68
"ui-icon-background ui-icon-" + icon ,
69
69
"Icon has proper classes" ) ;
70
+ if ( icon === "blank" ) {
71
+ assert . lacksClasses ( iconElement , "ui-icon-check ui-state-highlight" ) ;
72
+ }
70
73
}
71
74
test ( "icon - false on init" , function ( ) {
72
75
var checkbox = $ ( "#checkbox-option-icon" ) ;
@@ -76,36 +79,43 @@ test( "icon - false on init", function() {
76
79
checkbox . checkboxradio ( { icon : false } ) ;
77
80
assertNoIcon ( checkbox ) ;
78
81
} ) ;
79
-
80
82
test ( "icon - default unchecked" , function ( assert ) {
81
83
var checkbox = $ ( "#checkbox-option-icon" ) ;
82
84
83
- expect ( 2 ) ;
85
+ expect ( 3 ) ;
84
86
85
87
checkbox . checkboxradio ( ) ;
86
88
assertIcon ( checkbox , false , assert ) ;
87
89
} ) ;
90
+ test ( "icon - default checked" , function ( assert ) {
91
+ var checkbox = $ ( "#checkbox-option-icon" ) . attr ( "checked" , true ) ;
92
+
93
+ expect ( 2 ) ;
94
+
95
+ checkbox . checkboxradio ( ) ;
96
+ assertIcon ( checkbox , "check ui-state-highlight" , assert ) ;
97
+ } ) ;
88
98
test ( "icon" , function ( assert ) {
89
99
var checkbox = $ ( "#checkbox-option-icon" ) ;
90
100
91
- expect ( 8 ) ;
101
+ expect ( 9 ) ;
92
102
93
103
checkbox . prop ( "checked" , true ) ;
94
104
95
105
checkbox . checkboxradio ( ) ;
96
- assertIcon ( checkbox , "check" , assert ) ;
106
+ assertIcon ( checkbox , "check ui-state-highlight " , assert ) ;
97
107
98
108
checkbox . checkboxradio ( "option" , "icon" , false ) ;
99
109
assertNoIcon ( checkbox ) ;
100
110
101
111
checkbox . checkboxradio ( "option" , "icon" , true ) ;
102
- assertIcon ( checkbox , "check" , assert ) ;
112
+ assertIcon ( checkbox , "check ui-state-highlight " , assert ) ;
103
113
104
114
checkbox . checkboxradio ( "option" , "icon" , false ) ;
105
115
assertNoIcon ( checkbox ) ;
106
116
107
- checkbox . prop ( "checked" , false ) . checkboxradio ( "refresh" ) ;
108
117
checkbox . checkboxradio ( "option" , "icon" , true ) ;
118
+ checkbox . prop ( "checked" , false ) . checkboxradio ( "refresh" ) ;
109
119
assertIcon ( checkbox , false , assert ) ;
110
120
111
121
} ) ;
0 commit comments