X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=eee1740d6361d99c959eccbe1d3db98169772cb1;hb=971840f343dae04fdc6ff51ecb03ec8b3aaee067;hp=730e18c8f4b3788960dc153f12151786907b1f33;hpb=b45325765327d257f00b55cd5383287c1bd94875;p=jquery.git
diff --git a/test/unit/core.js b/test/unit/core.js
index 730e18c..eee1740 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -123,11 +123,18 @@ test("isFunction", function() {
});
});
+var foo = false;
+
test("$('html')", function() {
- expect(2);
+ expect(4);
reset();
- ok( $("")[0], "Creating a script" );
+ foo = false;
+ var s = $("")[0];
+ ok( s, "Creating a script" );
+ ok( !foo, "Make sure the script wasn't executed prematurely" );
+ $("body").append(s);
+ ok( foo, "Executing a scripts contents in the right context" );
reset();
ok( $("")[0], "Creating a link" );
@@ -817,11 +824,14 @@ test("val()", function() {
});
test("val(String)", function() {
- expect(2);
+ expect(3);
document.getElementById('text1').value = "bla";
ok( $("#text1").val() == "bla", "Check for modified value of input element" );
$("#text1").val('test');
ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );
+
+ $("#select1").val("3");
+ ok( $("#select1").val() == "3", "Check for modified (via val(String)) value of select element" );
});
test("html(String)", function() {