Skip to content
Permalink
Browse files

test runner: adding some tests that were missing for the $ constructor.

  • Loading branch information
flesler committed May 6, 2008
1 parent e6fccd7 commit 6fc2c67581e3feffc757bb6b1e719e589bd7a5b2
Showing with 10 additions and 1 deletion.
  1. +10 −1 test/unit/core.js
@@ -12,7 +12,7 @@ test("Basic requirements", function() {
});

test("$()", function() {
expect(4);
expect(8);

var main = $("#main");
isSet( $("div p", main).get(), q("sndp", "en", "sap"), "Basic selector with jQuery object as context" );
@@ -41,6 +41,15 @@ test("$()", function() {
equals( img.length, 1, "Correct number of elements generated for img" );
var div = $("<div/><hr/><code/><b/>");
equals( div.length, 4, "Correct number of elements generated for div hr code b" );

// can actually yield more than one, when iframes are included, the window is an array as well
equals( $(window).length, 1, "Correct number of elements generated for window" );

equals( $(document).length, 1, "Correct number of elements generated for document" );

equals( $([1,2,3]).get(1), 2, "Test passing an array to the factory" );

equals( $(document.body).get(0), $('body').get(0), "Test passing an html node to the factory" );
});

test("browser", function() {

0 comments on commit 6fc2c67

Please sign in to comment.
You can’t perform that action at this time.