Added support for .closest(filter, DOMElement). Fixes #4072.
[jquery.git] / test / unit / traversing.js
index 16f6043..1a7e6ee 100644 (file)
@@ -101,10 +101,10 @@ test("closest()", function() {
        isSet( jQuery("div").closest("body:first div:last").get(), q("fx-tests"), "closest(body:first div:last)" );
 
        // Test .closest() limited by the context
-       var jq = jQuery("#nothiddendivchild", document.body);
-       isSet( jq.closest("html").get(), [], "Context limited." );
-       isSet( jq.closest("body").get(), [], "Context limited." );
-       isSet( jq.closest("#nothiddendiv").get(), q("nothiddendiv"), "Context not reached." );
+       var jq = jQuery("#nothiddendivchild");
+       isSet( jq.closest("html", document.body).get(), [], "Context limited." );
+       isSet( jq.closest("body", document.body).get(), [], "Context limited." );
+       isSet( jq.closest("#nothiddendiv", document.body).get(), q("nothiddendiv"), "Context not reached." );
 });
 
 test("not(Selector)", function() {