Update unit tests with a leak detection mechanism for the various jQuery globals...
[jquery.git] / test / unit / dimensions.js
index b38e73b..fa59a9f 100644 (file)
@@ -1,4 +1,4 @@
-module("dimensions");
+module("dimensions", { teardown: moduleTeardown });
 
 function pass( val ) {
        return val;
@@ -33,6 +33,8 @@ function testWidth( val ) {
        var blah = jQuery("blah");
        equals( blah.width( val(10) ), blah, "Make sure that setting a width on an empty set returns the set." );
        equals( blah.width(), null, "Make sure 'null' is returned on an empty set");
+
+       jQuery.removeData($div[0], 'olddisplay', true);
 }
 
 test("width()", function() {
@@ -80,6 +82,8 @@ function testHeight( val ) {
        var blah = jQuery("blah");
        equals( blah.height( val(10) ), blah, "Make sure that setting a height on an empty set returns the set." );
        equals( blah.height(), null, "Make sure 'null' is returned on an empty set");
+
+       jQuery.removeData($div[0], 'olddisplay', true);
 }
 
 test("height()", function() {
@@ -126,6 +130,9 @@ test("innerWidth()", function() {
 
        // Temporarily require 0 for backwards compat - should be auto
        equals( div.innerWidth(), 0, "Make sure that disconnected nodes are handled." );
+
+       div.remove();
+       jQuery.removeData($div[0], 'olddisplay', true);
 });
 
 test("innerHeight()", function() {
@@ -152,6 +159,9 @@ test("innerHeight()", function() {
 
        // Temporarily require 0 for backwards compat - should be auto
        equals( div.innerHeight(), 0, "Make sure that disconnected nodes are handled." );
+
+       div.remove();
+       jQuery.removeData($div[0], 'olddisplay', true);
 });
 
 test("outerWidth()", function() {
@@ -179,6 +189,9 @@ test("outerWidth()", function() {
 
        // Temporarily require 0 for backwards compat - should be auto
        equals( div.outerWidth(), 0, "Make sure that disconnected nodes are handled." );
+
+       div.remove();
+       jQuery.removeData($div[0], 'olddisplay', true);
 });
 
 test("outerHeight()", function() {
@@ -205,4 +218,7 @@ test("outerHeight()", function() {
 
        // Temporarily require 0 for backwards compat - should be auto
        equals( div.outerHeight(), 0, "Make sure that disconnected nodes are handled." );
+
+       div.remove();
+       jQuery.removeData($div[0], 'olddisplay', true);
 });