Update unit tests with a leak detection mechanism for the various jQuery globals...
[jquery.git] / test / unit / data.js
index 28e19a3..889fc2d 100644 (file)
@@ -301,6 +301,8 @@ test("data-* attributes", function() {
        div.data("attr", "internal").attr("data-attr", "external");
        equals( div.data("attr"), "internal", "Check for .data('attr') precedence (internal > external data-* attribute)" );
 
+       div.remove();
+
        child.appendTo('#main');
        equals( child.data("myobj"), "old data", "Value accessed from data-* attribute");
 
@@ -312,6 +314,8 @@ test("data-* attributes", function() {
 
        var obj = child.data(), obj2 = dummy.data(), check = [ "myobj", "ignored", "other" ], num = 0, num2 = 0;
 
+       dummy.remove();
+
        for ( var i = 0, l = check.length; i < l; i++ ) {
                ok( obj[ check[i] ], "Make sure data- property exists when calling data-." );
                ok( obj2[ check[i] ], "Make sure data- property exists when calling data-." );