aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-03-02 10:53:54 -0500
committerjeresig <jeresig@gmail.com>2010-03-02 10:53:54 -0500
commitad103c8e6a2fead02822360583d56bcf42c032c4 (patch)
treef1ddb010aed288fc224ae7b76a13032c99fc8fb6 /test
parent5c111a028a2c86f2392d987951db3a980900f1bd (diff)
downloadjquery-ad103c8e6a2fead02822360583d56bcf42c032c4.tar.gz
jquery-ad103c8e6a2fead02822360583d56bcf42c032c4.zip
Add in the new level information to the closest(Array) test.
Diffstat (limited to 'test')
-rw-r--r--test/unit/traversing.js12
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
+});