remove and detach unit tests were not cleaning up, causing selector tests to fail
[jquery.git] / test / unit / manipulation.js
index 8a61ba6..49d717f 100644 (file)
@@ -639,9 +639,9 @@ var testHtml = function(valueObj) {
 
        stop();
 
-       jQuery("#main").html(valueObj('<script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script>'));
+       jQuery("#main").html(valueObj('<script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (1)" );</script>'));
 
-       jQuery("#main").html(valueObj('foo <form><script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script></form>'));
+       jQuery("#main").html(valueObj('foo <form><script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (2)" );</script></form>'));
 
        // it was decided that waiting to execute ALL scripts makes sense since nested ones have to wait anyway so this test case is changed, see #1959
        jQuery("#main").html(valueObj("<script>equals(jQuery.scriptorder++, 0, 'Script is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html (even though appears before)')<\/script><span id='scriptorder'><script>equals(jQuery.scriptorder++, 1, 'Script (nested) is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html')<\/script></span><script>equals(jQuery.scriptorder++, 2, 'Script (unnested) is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html')<\/script>"));
@@ -706,9 +706,11 @@ var testRemove = function(method) {
 
        var count = 0;
        var first = jQuery("#ap").children(":first");
-       first.click(function() { count++ })[method]().appendTo("body").click();
-
+       var cleanUp = first.click(function() { count++ })[method]().appendTo("body").click();
+       
        equals( method == "remove" ? 0 : 1, count );
+       
+       cleanUp.detach();
 };
 
 test("remove()", function() {