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

This commit is contained in:
jeresig 2010-03-02 10:53:54 -05:00
parent 5c111a028a
commit ad103c8e6a

View file

@ -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." );
});
});