aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/traversing.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-09-27 15:45:02 -0400
committerjeresig <jeresig@gmail.com>2010-09-27 15:45:02 -0400
commit8c41325a081f4009aa94748b9b6045e50a78422e (patch)
tree0089549ab4ffe6894616d5c5ece5d3b783bcf26c /test/unit/traversing.js
parente63fa8beb8e285fe19fc0a1557045b80e3c63c66 (diff)
parenta2bd8a53f3a750606abea9bbb6ee2302437d42f3 (diff)
downloadjquery-8c41325a081f4009aa94748b9b6045e50a78422e.tar.gz
jquery-8c41325a081f4009aa94748b9b6045e50a78422e.zip
Merge branch 'closestbug-6700' of http://github.com/ajpiano/jquery into ajpiano-closestbug-6700
Diffstat (limited to 'test/unit/traversing.js')
-rw-r--r--test/unit/traversing.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/traversing.js b/test/unit/traversing.js
index 4233f70f9..c7279cfe5 100644
--- a/test/unit/traversing.js
+++ b/test/unit/traversing.js
@@ -120,7 +120,7 @@ test("filter(jQuery)", function() {
})
test("closest()", function() {
- expect(9);
+ expect(10);
same( jQuery("body").closest("body").get(), q("body"), "closest(body)" );
same( jQuery("body").closest("html").get(), q("html"), "closest(html)" );
same( jQuery("body").closest("div").get(), [], "closest(div)" );
@@ -134,6 +134,10 @@ test("closest()", function() {
same( jq.closest("html", document.body).get(), [], "Context limited." );
same( jq.closest("body", document.body).get(), [], "Context limited." );
same( jq.closest("#nothiddendiv", document.body).get(), q("nothiddendiv"), "Context not reached." );
+
+ //Test that .closest() returns unique'd set
+ equals( jQuery('#main p').closest('#main').length, 1, "Closest should return a unique set" );
+
});
test("closest(Array)", function() {