From 0059722b6b43c4985dbbd5f1494524442c12ddb0 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 1 Apr 2014 14:42:38 -0400 Subject: Button: Properly refresh button sets with new radio buttons Fixes #8975 Ref gh-888 --- tests/unit/button/button.html | 5 +++++ tests/unit/button/button_methods.js | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/unit/button/button.html b/tests/unit/button/button.html index e016a06b0..a6ff8fc61 100644 --- a/tests/unit/button/button.html +++ b/tests/unit/button/button.html @@ -40,6 +40,11 @@ +
+ + + +
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( + "" + + "" + ); + checkboxButtonset.append( + "" + + "" + ); + + radioButtonset.buttonset( "refresh" ); + checkboxButtonset.buttonset( "refresh" ); + + equal( radioButtonset.find( ":ui-button" ).length, 4, "radio" ); + equal( checkboxButtonset.find( ":ui-button" ).length, 4, "checkbox" ); +}); + })(jQuery); -- cgit v1.2.3