diff options
author | John Resig <jeresig@gmail.com> | 2008-12-22 00:52:53 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2008-12-22 00:52:53 +0000 |
commit | 6b090328643988869e2288a4874935680d8573ca (patch) | |
tree | 54ac9a37ae9ef7ea4ed41a65364e0372a3782d3d /test | |
parent | c9dd5d997229919b8dd4cc402b7b7a465982071a (diff) | |
download | jquery-6b090328643988869e2288a4874935680d8573ca.tar.gz jquery-6b090328643988869e2288a4874935680d8573ca.zip |
Added support for the new .closest() method (very useful for event delegation).
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/core.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index 536e58cf5..1ae2dfa5f 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1309,6 +1309,14 @@ test("filter()", function() { equals( j.filter("[name]").length, 0, "Check node,textnode,comment to filter the one span" ); }); +test("closest()", function() { + expect(4); + isSet( jQuery("body").closest("body").get(), q("body"), "closest(body)" ); + isSet( jQuery("body").closest("html").get(), q("html"), "closest(html)" ); + isSet( jQuery("body").closest("div").get(), [], "closest(div)" ); + isSet( jQuery("#main").closest("span,#html").get(), q("html"), "closest(span,#html)" ); +}); + test("not()", function() { expect(8); equals( jQuery("#main > p#ap > a").not("#google").length, 2, "not('selector')" ); |