aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-05-04 11:29:38 -0400
committertimmywil <tim.willison@thisismedium.com>2011-05-04 11:29:38 -0400
commit480b88ca37fb3aff4ba043298a8fb419905d3f21 (patch)
tree6f15e9b60253cddfc64b3b4e60e82389abc8c178 /test
parent97144424ccb79e251d6df354384fa3e4d5362949 (diff)
downloadjquery-480b88ca37fb3aff4ba043298a8fb419905d3f21.tar.gz
jquery-480b88ca37fb3aff4ba043298a8fb419905d3f21.zip
Set corresponding property to false when removing boolean attributes. Fixes #9094
Diffstat (limited to 'test')
-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 b20a14fcb..80efed829 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -405,12 +405,17 @@ test("attr('tabindex', value)", function() {
});
test("removeAttr(String)", function() {
- expect(5);
+ expect(7);
equals( jQuery("#mark").removeAttr( "class" )[0].className, "", "remove class" );
equals( jQuery("#form").removeAttr("id").attr("id"), undefined, "Remove id" );
equals( jQuery("#foo").attr("style", "position:absolute;").removeAttr("style").attr("style"), undefined, "Check removing style attribute" );
equals( jQuery("#form").attr("style", "position:absolute;").removeAttr("style").attr("style"), undefined, "Check removing style attribute on a form" );
equals( jQuery("#fx-test-group").attr("height", "3px").removeAttr("height").css("height"), "1px", "Removing height attribute has no effect on height set with style attribute" );
+
+ jQuery("#check1").removeAttr("checked").prop("checked", true).removeAttr("checked");
+ equals( document.getElementById("check1").checked, false, "removeAttr sets boolean properties to false" );
+ jQuery("#text1").prop("readOnly", true).removeAttr("readonly");
+ equals( document.getElementById("text1").readOnly, false, "removeAttr sets boolean properties to false" );
});
test("prop(String, Object)", function() {