aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-05-18 11:46:22 -0400
committertimmywil <tim.willison@thisismedium.com>2011-05-18 11:46:22 -0400
commit25118e22a204c5396f1265feb5cbfd71f35033e3 (patch)
tree55bae571f803ad9db0a7d4448f3fea744e2011a0 /test
parentba90af0dc5b279d785e49ff5c051073d2178d372 (diff)
downloadjquery-25118e22a204c5396f1265feb5cbfd71f35033e3.tar.gz
jquery-25118e22a204c5396f1265feb5cbfd71f35033e3.zip
Handle unset value attributes consistently depending on property existence. Supplements #9328.
Diffstat (limited to 'test')
-rw-r--r--test/unit/attributes.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 546aaffa5..c4ed7d30f 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(43);
+ expect(45);
equals( jQuery("#text1").attr("type"), "text", "Check for type attribute" );
equals( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" );
@@ -126,6 +126,8 @@ test("attr(String)", function() {
ok( jQuery("<div/>").attr("title") === undefined, "Make sure undefined is returned when no attribute is found." );
equal( jQuery("<div/>").attr("title", "something").attr("title"), "something", "Set the title attribute." );
ok( jQuery().attr("doesntexist") === undefined, "Make sure undefined is returned when no element is there." );
+ equal( jQuery("<div/>").attr("value"), undefined, "An unset value on a div returns undefined." );
+ equal( jQuery("<input/>").attr("value"), "", "An unset value on an input returns current value." );
});
if ( !isLocal ) {