diff options
author | jeresig <jeresig@gmail.com> | 2010-09-27 20:59:42 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-09-27 20:59:42 -0400 |
commit | 7be11207b9267592a639eb739dc8d719c7de56a1 (patch) | |
tree | 231d3f1010c8d457888983c6fbe196e771d3f64d /test/unit | |
parent | 8c41325a081f4009aa94748b9b6045e50a78422e (diff) | |
download | jquery-7be11207b9267592a639eb739dc8d719c7de56a1.tar.gz jquery-7be11207b9267592a639eb739dc8d719c7de56a1.zip |
Removing unique check on closest(Array) (it wasn't appropriate there and broke functionality elsewhere) - follow-up to commit 8c41325a081f4009aa94748b9b6045e50a78422e. Also added another test for closest(Array) after a discussion with @jitter in 26b0e913dda386b6b2848196689a02a2da6aa40d.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/traversing.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js index c7279cfe5..3fd98f674 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -141,10 +141,11 @@ test("closest()", function() { }); test("closest(Array)", function() { - expect(6); + expect(7); 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("#yahoo").closest(["div"]), [{"selector":"div", "elem": document.getElementById("foo"), "level": 3}, { "selector": "div", "elem": document.getElementById("main"), "level": 4 }], "closest([div])" ); 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, level:1}, {selector:"html", elem:document.documentElement, level:2}], "closest([body, html])" ); |