diff options
author | Scott González <scott.gonzalez@gmail.com> | 2014-04-01 14:42:38 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2014-04-01 14:42:38 -0400 |
commit | 0059722b6b43c4985dbbd5f1494524442c12ddb0 (patch) | |
tree | 73d80beaecb0832da98b0ae9fadd5632a425e3ed /tests/unit/button/button_methods.js | |
parent | f3ffc8c9a94da8abe97a32d164f821ad8a9a8b60 (diff) | |
download | jquery-ui-0059722b6b43c4985dbbd5f1494524442c12ddb0.tar.gz jquery-ui-0059722b6b43c4985dbbd5f1494524442c12ddb0.zip |
Button: Properly refresh button sets with new radio buttons
Fixes #8975
Ref gh-888
Diffstat (limited to 'tests/unit/button/button_methods.js')
-rw-r--r-- | tests/unit/button/button_methods.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/button/button_methods.js b/tests/unit/button/button_methods.js index 467938f00..1c781c87e 100644 --- a/tests/unit/button/button_methods.js +++ b/tests/unit/button/button_methods.js @@ -49,4 +49,26 @@ test( "refresh: Ensure disabled state is preserved correctly.", function() { ok( !element.button( "option", "disabled" ), "Changing a radio button's disabled property should update the state after refresh."); }); +// #8975 +test( "refresh: buttonset should turn added elements into button widgets", function() { + expect( 2 ); + var radioButtonset = $( "#radio0" ).buttonset(), + checkboxButtonset = $( "#checkbox0" ).buttonset(); + + radioButtonset.append( + "<input type='radio' name='radio' id='radio04'>" + + "<label for='radio04'>Choice 4</label>" + ); + checkboxButtonset.append( + "<input type='checkbox' name='checkbox' id='checkbox04'>" + + "<label for='checkbox04'>Choice 4</label>" + ); + + radioButtonset.buttonset( "refresh" ); + checkboxButtonset.buttonset( "refresh" ); + + equal( radioButtonset.find( ":ui-button" ).length, 4, "radio" ); + equal( checkboxButtonset.find( ":ui-button" ).length, 4, "checkbox" ); +}); + })(jQuery); |