r3603 committed - Button: destroy button instances after each test. Mdofied destroy test...

r3603 committed - Button: destroy button instances after each test. Mdofied destroy test...

Revision: 3603
Author: scott.gonzalez
Date: Sun Jan 3 17:48:10 2010
Log: Button: destroy button instances after each test. Mdofied destroy test
to check the outerhtml of the button for fuller coverage.
http://code.google.com/p/jquery-ui/source/detail?r=3603
Modified:
/branches/dev/tests/unit/button/button_methods.js
/branches/dev/tests/unit/button/button_options.js
=======================================
--- /branches/dev/tests/unit/button/button_methods.js    Sun Jan 3 10:09:25
2010
+++ /branches/dev/tests/unit/button/button_methods.js    Sun Jan 3 17:48:10
2010
@@ -7,12 +7,9 @@
module("button: methods");
test("destroy", function() {
-    var beforeHtml = $("#button").html()
-        beforeClasses = $("#button").attr("class");
-    var afterHtml = $("#button").button().button("destroy").html()
-        afterClasses = $("#button").attr("class");
+    var beforeHtml = $("#button").parent().html();
+    var afterHtml = $("#button").button().button("destroy").parent().html();
    same( beforeHtml, afterHtml );
-    same( beforeClasses, afterClasses );
});
})(jQuery);
=======================================
--- /branches/dev/tests/unit/button/button_options.js    Sun Jan 3 10:09:25
2010
+++ /branches/dev/tests/unit/button/button_options.js    Sun Jan 3 17:48:10
2010
@@ -10,6 +10,8 @@
        text: false
    });
    ok( $("#button").is(".ui-button-text-only:not(.ui-button-icon-only)") );
+
+    $("#button").button("destroy");
});
test("text false with icon", function() {
@@ -20,11 +22,15 @@
        }
    });
    ok(
$("#button").is(".ui-button-icon-only:not(.ui-button-text):has(span.ui-icon.iconclass)")
);
+
+    $("#button").button("destroy");
});
test("label, default", function() {
    $("#button").button();
    same( "Label", $("#button").text() );
+
+    $("#button").button("destroy");
});
test("label", function() {
@@ -32,6 +38,8 @@
        label: "xxx"
    });
    same( "xxx", $("#button").text() );
+
+    $("#button").button("destroy");
});
test("icons", function() {
@@ -43,6 +51,8 @@
        }
    });
    ok(
$("#button").is(":has(span.ui-icon.ui-button-icon-primary.iconclass):has(span.ui-icon.ui-button-icon-secondary.iconclass2)")
);
+
+    $("#button").button("destroy");
});
})(jQuery);
--