git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:jquery/jquery
[jquery.git]
/
test
/
unit
/
manipulation.js
diff --git
a/test/unit/manipulation.js
b/test/unit/manipulation.js
index
0ebae16
..
9242ddd
100644
(file)
--- a/
test/unit/manipulation.js
+++ b/
test/unit/manipulation.js
@@
-619,7
+619,7
@@
test("clone() on XML nodes", function() {
}
test("val()", function() {
}
test("val()", function() {
- expect(15);
+ expect(17);
document.getElementById('text1').value = "bla";
equals( jQuery("#text1").val(), "bla", "Check for modified value of input element" );
document.getElementById('text1').value = "bla";
equals( jQuery("#text1").val(), "bla", "Check for modified value of input element" );
@@
-648,10
+648,13
@@
test("val()", function() {
var checks = jQuery("<input type='checkbox' name='test' value='1'/>").appendTo("#form")
.add( jQuery("<input type='checkbox' name='test' value='2'/>").appendTo("#form") )
var checks = jQuery("<input type='checkbox' name='test' value='1'/>").appendTo("#form")
.add( jQuery("<input type='checkbox' name='test' value='2'/>").appendTo("#form") )
- .add( jQuery("<input type='checkbox' name='test' value=''/>").appendTo("#form") );
+ .add( jQuery("<input type='checkbox' name='test' value=''/>").appendTo("#form") )
+ .add( jQuery("<input type='checkbox' name='test'/>").appendTo("#form") );
same( checks.serialize(), "", "Get unchecked values." );
same( checks.serialize(), "", "Get unchecked values." );
+ equals( checks.eq(3).val(), "on", "Make sure a value of 'on' is provided if none is specified." );
+
checks.val([ "2" ]);
same( checks.serialize(), "test=2", "Get a single checked value." );
checks.val([ "2" ]);
same( checks.serialize(), "test=2", "Get a single checked value." );
@@
-661,6
+664,9
@@
test("val()", function() {
checks.val([ "", "2" ]);
same( checks.serialize(), "test=2&test=", "Get multiple checked values." );
checks.val([ "", "2" ]);
same( checks.serialize(), "test=2&test=", "Get multiple checked values." );
+ checks.val([ "1", "on" ]);
+ same( checks.serialize(), "test=1&test=on", "Get multiple checked values." );
+
checks.remove();
});
checks.remove();
});