diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-10-06 17:01:23 +0200 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-10-08 14:03:00 -0400 |
commit | 52d9ec6c4d7402d5ef04b8c7959f812f8d095cef (patch) | |
tree | 3a628ce852b56c3371ecdf94fa81b20c03cb4dde /tests/unit/checkboxradio | |
parent | 9ff3d8fb90b53731401744a9f077c78b27aef1e4 (diff) | |
download | jquery-ui-52d9ec6c4d7402d5ef04b8c7959f812f8d095cef.tar.gz jquery-ui-52d9ec6c4d7402d5ef04b8c7959f812f8d095cef.zip |
Checkboxradio: Add ui-state-highlight class to icon on create
This was already toggled in _toggleClasses, but that isn't called
on create.
Diffstat (limited to 'tests/unit/checkboxradio')
-rw-r--r-- | tests/unit/checkboxradio/options.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/tests/unit/checkboxradio/options.js b/tests/unit/checkboxradio/options.js index 1614994c4..56daf7445 100644 --- a/tests/unit/checkboxradio/options.js +++ b/tests/unit/checkboxradio/options.js @@ -67,6 +67,9 @@ function assertIcon( checkbox, icon, assert ) { assert.hasClasses( iconElement, "ui-checkboxradio-icon ui-corner-all ui-icon " + "ui-icon-background ui-icon-" + icon, "Icon has proper classes" ); + if ( icon === "blank" ) { + assert.lacksClasses( iconElement, "ui-icon-check ui-state-highlight" ); + } } test( "icon - false on init", function() { var checkbox = $( "#checkbox-option-icon" ); @@ -76,36 +79,43 @@ test( "icon - false on init", function() { checkbox.checkboxradio( { icon: false } ); assertNoIcon( checkbox ); } ); - test( "icon - default unchecked", function( assert ) { var checkbox = $( "#checkbox-option-icon" ); - expect( 2 ); + expect( 3 ); checkbox.checkboxradio(); assertIcon( checkbox, false, assert ); } ); +test( "icon - default checked", function( assert ) { + var checkbox = $( "#checkbox-option-icon" ).attr( "checked", true ); + + expect( 2 ); + + checkbox.checkboxradio(); + assertIcon( checkbox, "check ui-state-highlight", assert ); +} ); test( "icon", function( assert ) { var checkbox = $( "#checkbox-option-icon" ); - expect( 8 ); + expect( 9 ); checkbox.prop( "checked", true ); checkbox.checkboxradio(); - assertIcon( checkbox, "check", assert ); + assertIcon( checkbox, "check ui-state-highlight", assert ); checkbox.checkboxradio( "option", "icon", false ); assertNoIcon( checkbox ); checkbox.checkboxradio( "option", "icon", true ); - assertIcon( checkbox, "check", assert ); + assertIcon( checkbox, "check ui-state-highlight", assert ); checkbox.checkboxradio( "option", "icon", false ); assertNoIcon( checkbox ); - checkbox.prop( "checked", false ).checkboxradio( "refresh" ); checkbox.checkboxradio( "option", "icon", true ); + checkbox.prop( "checked", false ).checkboxradio( "refresh" ); assertIcon( checkbox, false, assert ); } ); |