aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2017-04-19 11:32:13 -0400
committerScott González <scott.gonzalez@gmail.com>2017-05-02 15:11:24 -0400
commitabc9e7ce2f3b60a18bf1f461c7cbfccb3fa02b53 (patch)
treeca02e5f358c31b742d706724eaa291c52e175c8d /tests
parentc866e455373028a62a0956455a229fef63e91fac (diff)
downloadjquery-ui-abc9e7ce2f3b60a18bf1f461c7cbfccb3fa02b53.tar.gz
jquery-ui-abc9e7ce2f3b60a18bf1f461c7cbfccb3fa02b53.zip
Button: Fix backcompat when called on collection of mixed elements
Fixes #15109 Closes gh-1808
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/button/deprecated.html8
-rw-r--r--tests/unit/button/deprecated.js18
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/button/deprecated.html b/tests/unit/button/deprecated.html
index 73f62921c..8b5270baa 100644
--- a/tests/unit/button/deprecated.html
+++ b/tests/unit/button/deprecated.html
@@ -56,6 +56,14 @@
<button id="button1">Button</button>
<a href="#" id="anchor-button">Anchor Button</a>
+<div class="mixed">
+ <a href="#" id="mixed-anchor">Anchor</a>
+ <button id="mixed-button" disabled>Button</button>
+ <input type="button" value="Button" id="mixed-input">
+ <input type="checkbox" id="mixed-check" name="check"><label for="mixed-check">Check</label>
+ <input type="radio" id="mixed-radio" name="radio"><label for="mixed-radio">Radio</label>
+</div>
+
</div>
</body>
</html>
diff --git a/tests/unit/button/deprecated.js b/tests/unit/button/deprecated.js
index 81a0281b7..86fca797e 100644
--- a/tests/unit/button/deprecated.js
+++ b/tests/unit/button/deprecated.js
@@ -194,4 +194,22 @@ QUnit.test( "icon / icons options properly proxied", function( assert ) {
"Icons secondary option sets iconPosition option to end on init" );
} );
+QUnit.test( "Calling button on a collection of mixed types works correctly", function( assert ) {
+ assert.expect( 5 );
+
+ var group = $( ".mixed" ).children();
+
+ group.button();
+
+ $.each( {
+ anchor: "button",
+ button: "button",
+ check: "checkboxradio",
+ input: "button",
+ radio: "checkboxradio"
+ }, function( type, widget ) {
+ assert.ok( $( "#mixed-" + type )[ widget ]( "instance" ), type + " is a " + widget );
+ } );
+} );
+
} );