aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/button/button_tickets.js
diff options
context:
space:
mode:
authorddstreet <ddstreet@ieee.org>2011-03-11 10:52:13 -0500
committerScott González <scott.gonzalez@gmail.com>2011-03-11 10:52:13 -0500
commit0b30a1d450f6b7d529732d6a39c5f4057efaaaf4 (patch)
tree67fb01a30db6900f21d9b179af8835078140b4fc /tests/unit/button/button_tickets.js
parent0eb1106b5b7a1ad01d76c38b1cbb5b16e55ca156 (diff)
downloadjquery-ui-0b30a1d450f6b7d529732d6a39c5f4057efaaaf4.tar.gz
jquery-ui-0b30a1d450f6b7d529732d6a39c5f4057efaaaf4.zip
Button: find associated label even without common ancestor. Fixes #7092 - button creation that requires a matching label does not find label in all cases
Diffstat (limited to 'tests/unit/button/button_tickets.js')
-rw-r--r--tests/unit/button/button_tickets.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unit/button/button_tickets.js b/tests/unit/button/button_tickets.js
index 5c5053ded..79bbfeb5c 100644
--- a/tests/unit/button/button_tickets.js
+++ b/tests/unit/button/button_tickets.js
@@ -20,4 +20,26 @@ test( "#6262 - buttonset not applying ui-corner to invisible elements", function
ok( set.find( "label:eq(2)" ).is( ".ui-button.ui-corner-right" ) );
});
+test( "#7092 - button creation that requires a matching label does not find label in all cases", function() {
+ var group = $( "<span><label for='t7092a'/><input type='checkbox' id='t7092a'/></span>" );
+ group.find( "input:checkbox" ).button();
+ ok( group.find( "label" ).is( ".ui-button" ) );
+
+ group = $( "<input type='checkbox' id='t7092b'/><label for='t7092b'/>" );
+ group.filter( "input:checkbox" ).button();
+ ok( group.filter( "label" ).is( ".ui-button" ) );
+
+ group = $( "<span><input type='checkbox' id='t7092c'/></span><label for='t7092c'/>" );
+ group.find( "input:checkbox" ).button();
+ ok( group.filter( "label" ).is( ".ui-button" ) );
+
+ group = $( "<span><input type='checkbox' id='t7092d'/></span><span><label for='t7092d'/></span>" );
+ group.find( "input:checkbox" ).button();
+ ok( group.find( "label" ).is( ".ui-button" ) );
+
+ group = $( "<input type='checkbox' id='t7092e'/><span><label for='t7092e'/></span>" );
+ group.filter( "input:checkbox" ).button();
+ ok( group.find( "label" ).is( ".ui-button" ) );
+});
+
})( jQuery );