Skip to content
Browse files

Add in the new level information to the closest(Array) test.

  • Loading branch information...
1 parent 5c111a0 commit ad103c8e6a2fead02822360583d56bcf42c032c4 @jeresig jeresig committed Mar 2, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/unit/traversing.js
View
12 test/unit/traversing.js
@@ -138,13 +138,13 @@ test("closest()", function() {
test("closest(Array)", function() {
expect(6);
- same( jQuery("body").closest(["body"]), [{selector:"body", elem:document.body}], "closest([body])" );
- same( jQuery("body").closest(["html"]), [{selector:"html", elem:document.documentElement}], "closest([html])" );
+ same( jQuery("body").closest(["body"]), [{selector:"body", elem:document.body, level:1}], "closest([body])" );
+ same( jQuery("body").closest(["html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([html])" );
same( jQuery("body").closest(["div"]), [], "closest([div])" );
- same( jQuery("#main").closest(["span,#html"]), [{selector:"span,#html", elem:document.documentElement}], "closest([span,#html])" );
+ same( jQuery("#main").closest(["span,#html"]), [{selector:"span,#html", elem:document.documentElement, level:4}], "closest([span,#html])" );
- same( jQuery("body").closest(["body","html"]), [{selector:"body", elem:document.body}, {selector:"html", elem:document.documentElement}], "closest([body, html])" );
- same( jQuery("body").closest(["span","html"]), [{selector:"html", elem:document.documentElement}], "closest([body, html])" );
+ same( jQuery("body").closest(["body","html"]), [{selector:"body", elem:document.body, level:1}, {selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" );
+ same( jQuery("body").closest(["span","html"]), [{selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" );
});
test("not(Selector)", function() {
@@ -437,4 +437,4 @@ test("add(String, Context)", function() {
equals( jQuery(document).add("#form", document).length, 2, "Use a passed in document context." );
equals( jQuery(document).add("#form", document.body).length, 2, "Use a passed in body context." );
equals( jQuery(document).add("#html", document.body).length, 1, "Use a passed in body context." );
-});
+});

0 comments on commit ad103c8

Please sign in to comment.
Something went wrong with that request. Please try again.