From 6f676e692d48b4f979ba1dfc5d10f3f16954b381 Mon Sep 17 00:00:00 2001 From: timmywil Date: Thu, 12 May 2011 19:42:53 -0400 Subject: Use prop to retrieve boolean properties (so the selected hook will be used) --- test/unit/attributes.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/unit/attributes.js b/test/unit/attributes.js index d2d43475d..efeb46e48 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -40,7 +40,7 @@ test("jQuery.attrFix/jQuery.propFix integrity test", function() { }); test("attr(String)", function() { - expect(37); + expect(38); equals( jQuery("#text1").attr("type"), "text", "Check for type attribute" ); equals( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" ); @@ -92,6 +92,12 @@ test("attr(String)", function() { body.removeAttribute("foo"); // Cleanup + var select = document.createElement("select"), optgroup = document.createElement("optgroup"), option = document.createElement("option"); + optgroup.appendChild( option ); + select.appendChild( optgroup ); + + equal( jQuery( option ).attr("selected"), "selected", "Make sure that a single option is selected, even when in an optgroup." ); + var $img = jQuery("").appendTo("body"); equals( $img.attr("width"), "215", "Retrieve width attribute an an element with display:none." ); equals( $img.attr("height"), "53", "Retrieve height attribute an an element with display:none." ); -- cgit v1.2.3