aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorUri Gilad <antishok@gmail.com>2012-07-10 10:14:43 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-07-10 10:14:43 -0400
commitf843a7062fef5a262c244575712b8173ced7c1a2 (patch)
treea92fe52c12eb6e25c413bb96f2396864c27e2fcd /test
parentb6cb4b420fc0ddf47d94fc867df5d1ec487438b6 (diff)
downloadjquery-f843a7062fef5a262c244575712b8173ced7c1a2.tar.gz
jquery-f843a7062fef5a262c244575712b8173ced7c1a2.zip
Fix #10517. before() and after() on disconnected node should return multiple nodes. Closes gh-851.
Diffstat (limited to 'test')
-rw-r--r--test/unit/manipulation.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 525c1387b..5d794b9bc 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -917,6 +917,13 @@ test("before and after w/ empty object (#10812)", function() {
equal( res.wrapAll("<div/>").parent().text(), "()", "correctly appended text" );
});
+test("before and after on disconnected node (#10517)", function() {
+ expect(2);
+
+ equal( jQuery("<input type='checkbox'/>").before("<div/>").length, 2, "before() returned all elements" );
+ equal( jQuery("<input type='checkbox'/>").after("<div/>").length, 2, "after() returned all elements" );
+});
+
test("insertBefore(String|Element|Array&lt;Element&gt;|jQuery)", function() {
expect(4);
var expected = "This is a normal link: bugaYahoo";