@@ -67,6 +67,9 @@ function assertIcon( checkbox, icon, assert ) {
6767 assert . hasClasses ( iconElement , "ui-checkboxradio-icon ui-corner-all ui-icon " +
6868 "ui-icon-background ui-icon-" + icon ,
6969 "Icon has proper classes" ) ;
70+ if ( icon === "blank" ) {
71+ assert . lacksClasses ( iconElement , "ui-icon-check ui-state-highlight" ) ;
72+ }
7073}
7174test ( "icon - false on init" , function ( ) {
7275 var checkbox = $ ( "#checkbox-option-icon" ) ;
@@ -76,36 +79,43 @@ test( "icon - false on init", function() {
7679 checkbox . checkboxradio ( { icon : false } ) ;
7780 assertNoIcon ( checkbox ) ;
7881} ) ;
79-
8082test ( "icon - default unchecked" , function ( assert ) {
8183 var checkbox = $ ( "#checkbox-option-icon" ) ;
8284
83- expect ( 2 ) ;
85+ expect ( 3 ) ;
8486
8587 checkbox . checkboxradio ( ) ;
8688 assertIcon ( checkbox , false , assert ) ;
8789} ) ;
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+ } ) ;
8898test ( "icon" , function ( assert ) {
8999 var checkbox = $ ( "#checkbox-option-icon" ) ;
90100
91- expect ( 8 ) ;
101+ expect ( 9 ) ;
92102
93103 checkbox . prop ( "checked" , true ) ;
94104
95105 checkbox . checkboxradio ( ) ;
96- assertIcon ( checkbox , "check" , assert ) ;
106+ assertIcon ( checkbox , "check ui-state-highlight " , assert ) ;
97107
98108 checkbox . checkboxradio ( "option" , "icon" , false ) ;
99109 assertNoIcon ( checkbox ) ;
100110
101111 checkbox . checkboxradio ( "option" , "icon" , true ) ;
102- assertIcon ( checkbox , "check" , assert ) ;
112+ assertIcon ( checkbox , "check ui-state-highlight " , assert ) ;
103113
104114 checkbox . checkboxradio ( "option" , "icon" , false ) ;
105115 assertNoIcon ( checkbox ) ;
106116
107- checkbox . prop ( "checked" , false ) . checkboxradio ( "refresh" ) ;
108117 checkbox . checkboxradio ( "option" , "icon" , true ) ;
118+ checkbox . prop ( "checked" , false ) . checkboxradio ( "refresh" ) ;
109119 assertIcon ( checkbox , false , assert ) ;
110120
111121} ) ;
0 commit comments