aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/attributes.js
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-05-13 13:39:38 -0400
committertimmywil <tim.willison@thisismedium.com>2011-05-13 13:39:38 -0400
commitbc82ff0ff9faba5e7e8c3e40f1351fb5e3fc1a41 (patch)
tree7f3e2c9eb90e281b3ffeaffece269c6d09217ddc /test/unit/attributes.js
parent6f676e692d48b4f979ba1dfc5d10f3f16954b381 (diff)
downloadjquery-bc82ff0ff9faba5e7e8c3e40f1351fb5e3fc1a41.tar.gz
jquery-bc82ff0ff9faba5e7e8c3e40f1351fb5e3fc1a41.zip
Make sure setting boolean attributes to the same name sets the property to a boolean type
Diffstat (limited to 'test/unit/attributes.js')
-rw-r--r--test/unit/attributes.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index efeb46e48..79730026a 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -150,7 +150,7 @@ test("attr(Hash)", function() {
});
test("attr(String, Object)", function() {
- expect(66);
+ expect(69);
var div = jQuery("div").attr("foo", "bar"),
fail = false;
@@ -199,6 +199,11 @@ test("attr(String, Object)", function() {
equals( jQuery("#check2").prop("checked"), false, "Set checked attribute" );
equals( jQuery("#check2").attr("checked"), undefined, "Set checked attribute" );
+ jQuery("#check2").attr("checked", "checked");
+ equal( document.getElementById("check2").checked, true, "Set checked attribute with 'checked'" );
+ equal( jQuery("#check2").prop("checked"), true, "Set checked attribute" );
+ equal( jQuery("#check2").attr("checked"), "checked", "Set checked attribute" );
+
jQuery("#text1").prop("readOnly", true);
equals( document.getElementById("text1").readOnly, true, "Set readonly attribute" );
equals( jQuery("#text1").prop("readOnly"), true, "Set readonly attribute" );