aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2013-04-16 22:16:12 -0400
committerRick Waldron <waldron.rick@gmail.com>2013-04-16 22:18:44 -0400
commit77d7f264524677104cd7f37ecdb631d5824eacd4 (patch)
treea391a15673534ee7f60328793e47fc289becde7f /test
parentdb0326b1fdd22b97e24af34245e38914c04a70ba (diff)
downloadjquery-77d7f264524677104cd7f37ecdb631d5824eacd4.tar.gz
jquery-77d7f264524677104cd7f37ecdb631d5824eacd4.zip
Fixes #13779. Remove nodes in document order (uses for loop matching empty()).
Diffstat (limited to 'test')
-rw-r--r--test/unit/manipulation.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 73ad67715..30710da58 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -1572,6 +1572,30 @@ test( "remove() event cleaning ", 1, function() {
cleanUp.remove();
});
+test( "remove() in document order #13779", 1, function() {
+ var last,
+ cleanData = jQuery.cleanData;
+
+ jQuery.cleanData = function( nodes ) {
+ last = nodes[0].textContent;
+ cleanData.call( this, nodes );
+ };
+
+ jQuery("#qunit-fixture").append(
+ jQuery.parseHTML(
+ "<div class='removal-fixture'>1</div>" +
+ "<div class='removal-fixture'>2</div>" +
+ "<div class='removal-fixture'>3</div>"
+ )
+ );
+
+ jQuery(".removal-fixture").remove();
+
+ equal( last, 3, "The removal fixtures were removed in document order" );
+
+ jQuery.cleanData = cleanData;
+});
+
test( "detach()", 11, function() {
testRemove("detach");
});