aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/button
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/button')
-rw-r--r--tests/unit/button/button.html5
-rw-r--r--tests/unit/button/button_methods.js22
2 files changed, 27 insertions, 0 deletions
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 @@
<input type="radio" id="radio02" name="radio"><label for="radio02">Choice 2</label>
<input type="radio" id="radio03" name="radio"><label for="radio03">Choice 3</label>
</div>
+<div id="checkbox0">
+ <input type="checkbox" id="checkbox01" name="checkbox"><label for="checkbox01">Choice 1</label>
+ <input type="checkbox" id="checkbox02" name="checkbox"><label for="checkbox02">Choice 2</label>
+ <input type="checkbox" id="checkbox03" name="checkbox"><label for="checkbox03">Choice 3</label>
+</div>
<form>
<div id="radio1" style="margin-top: 2em;">
<input type="radio" id="radio11" name="radio"><label for="radio11">Choice 1</label>
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);