Commit e6da0fa6 authored by timmywil's avatar timmywil

Bug #7369: Add test for disconnected node in closest when passing attribute...

Bug #7369: Add test for disconnected node in closest when passing attribute selector; this was recently fixed in 1.5.2rc
parent b8013581
...@@ -148,7 +148,7 @@ test("filter(jQuery)", function() { ...@@ -148,7 +148,7 @@ test("filter(jQuery)", function() {
}) })
test("closest()", function() { test("closest()", function() {
expect(11); expect(12);
same( jQuery("body").closest("body").get(), q("body"), "closest(body)" ); same( jQuery("body").closest("body").get(), q("body"), "closest(body)" );
same( jQuery("body").closest("html").get(), q("html"), "closest(html)" ); same( jQuery("body").closest("html").get(), q("html"), "closest(html)" );
same( jQuery("body").closest("div").get(), [], "closest(div)" ); same( jQuery("body").closest("div").get(), [], "closest(div)" );
...@@ -168,6 +168,8 @@ test("closest()", function() { ...@@ -168,6 +168,8 @@ test("closest()", function() {
// Test on disconnected node // Test on disconnected node
equals( jQuery("<div><p></p></div>").find("p").closest("table").length, 0, "Make sure disconnected closest work." ); equals( jQuery("<div><p></p></div>").find("p").closest("table").length, 0, "Make sure disconnected closest work." );
// Bug #7369
equals( jQuery('<div foo="bar"></div>').closest('[foo]').length, 1, "Disconnected nodes with attribute selector" );
}); });
test("closest(Array)", function() { test("closest(Array)", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment