diff options
author | David Serduke <davidserduke@gmail.com> | 2007-12-04 19:37:03 +0000 |
---|---|---|
committer | David Serduke <davidserduke@gmail.com> | 2007-12-04 19:37:03 +0000 |
commit | 76e3a901530609d3c4a695ccb8a48251445c6861 (patch) | |
tree | ba61569fa048e511cf88c25ff95e7f52e31bbe18 /test | |
parent | d938c6bbd6b220f122c50f5f828b8f0cd818c168 (diff) | |
download | jquery-76e3a901530609d3c4a695ccb8a48251445c6861.tar.gz jquery-76e3a901530609d3c4a695ccb8a48251445c6861.zip |
Fixed #1763 by checking to see if .createElement() is available on the context and if isn't default to other contexts.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/core.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index f40f3b02e..f3a3aa3db 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -12,14 +12,19 @@ test("Basic requirements", function() { }); test("$()", function() { - expect(5); + expect(4); var main = $("#main"); isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" ); +/* + // disabled since this test was doing nothing. i tried to fix it but i'm not sure + // what the expected behavior should even be. FF returns "\n" for the text node // make sure this is handled - $('<p>\r\n</p>'); - ok( true, "Check for \\r and \\n in jQuery()" ); + var crlfContainer = $('<p>\r\n</p>'); + var x = crlfContainer.contents().get(0).nodeValue; + equals( x, what???, "Check for \\r and \\n in jQuery()" ); +*/ /* // Disabled until we add this functionality in var pass = true; @@ -148,7 +153,7 @@ var foo = false; test("$('html')", function() { expect(4); - + reset(); foo = false; var s = $("<script>var foo='test';</script>")[0]; @@ -163,6 +168,14 @@ test("$('html')", function() { reset(); }); +test("$('html', context)", function() { + expect(1); + + var $div = $("<div/>"); + var $span = $("<span/>", $div); + equals($span.length, 1, "Verify a span created with a div context works"); +}); + test("length", function() { expect(1); ok( $("p").length == 6, "Get Number of Elements Found" ); |