git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9e48649
)
test runner: adding 2 tests for .val( Number ).
author
Ariel Flesler
<aflesler@gmail.com>
Thu, 29 May 2008 00:03:45 +0000
(
00:03
+0000)
committer
Ariel Flesler
<aflesler@gmail.com>
Thu, 29 May 2008 00:03:45 +0000
(
00:03
+0000)
Removed a silly test.
test/unit/core.js
patch
|
blob
|
history
diff --git
a/test/unit/core.js
b/test/unit/core.js
index
eba9ce5
..
a0e7b1f
100644
(file)
--- a/
test/unit/core.js
+++ b/
test/unit/core.js
@@
-1140,24
+1140,30
@@
test("jQuery.extend(Object, Object)", function() {
});
\r
\r
test("val()", function() {
\r
});
\r
\r
test("val()", function() {
\r
- expect(4);
\r
+ expect(3);
\r
equals( jQuery("#text1").val(), "Test", "Check for value of input element" );
\r
equals( jQuery("#text1").val(), "Test", "Check for value of input element" );
\r
- equals( !jQuery("#text1").val(), "", "Check for value of input element" );
\r
// ticket #1714 this caused a JS error in IE
\r
equals( jQuery("#first").val(), "", "Check a paragraph element to see if it has a value" );
\r
ok( jQuery([]).val() === undefined, "Check an empty jQuery object will return undefined from val" );
\r
});
\r
\r
// ticket #1714 this caused a JS error in IE
\r
equals( jQuery("#first").val(), "", "Check a paragraph element to see if it has a value" );
\r
ok( jQuery([]).val() === undefined, "Check an empty jQuery object will return undefined from val" );
\r
});
\r
\r
-test("val(String)", function() {
\r
- expect(4);
\r
+test("val(String/Number)", function() {
\r
+ expect(6);
\r
document.getElementById('text1').value = "bla";
\r
equals( jQuery("#text1").val(), "bla", "Check for modified value of input element" );
\r
document.getElementById('text1').value = "bla";
\r
equals( jQuery("#text1").val(), "bla", "Check for modified value of input element" );
\r
+
\r
jQuery("#text1").val('test');
\r
jQuery("#text1").val('test');
\r
- ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );
\r
+ equals( document.getElementById('text1').value, "test", "Check for modified (via val(String)) value of input element" );
\r
+
\r
+ jQuery("#text1").val(67);
\r
+ equals( document.getElementById('text1').value, "67", "Check for modified (via val(Number)) value of input element" );
\r
\r
jQuery("#select1").val("3");
\r
equals( jQuery("#select1").val(), "3", "Check for modified (via val(String)) value of select element" );
\r
\r
\r
jQuery("#select1").val("3");
\r
equals( jQuery("#select1").val(), "3", "Check for modified (via val(String)) value of select element" );
\r
\r
+ jQuery("#select1").val(2);
\r
+ equals( jQuery("#select1").val(), "2", "Check for modified (via val(Number)) value of select element" );
\r
+
\r
// using contents will get comments regular, text, and comment nodes
\r
var j = jQuery("#nonnodes").contents();
\r
j.val("asdf");
\r
// using contents will get comments regular, text, and comment nodes
\r
var j = jQuery("#nonnodes").contents();
\r
j.val("asdf");
\r