diff options
Diffstat (limited to 'test/unit/traversing.js')
-rw-r--r-- | test/unit/traversing.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js index ecddfb03f..179e130ba 100644 --- a/test/unit/traversing.js +++ b/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." ); -});
\ No newline at end of file +}); |