r3602 committed - Button: minor changes to tests.

r3602 committed - Button: minor changes to tests.

Revision: 3602
Author: scott.gonzalez
Date: Sun Jan 3 17:44:34 2010
Log: Button: minor changes to tests.
http://code.google.com/p/jquery-ui/source/detail?r=3602
Modified:
/branches/dev/tests/unit/button/button.html
/branches/dev/tests/unit/button/button_core.js
/branches/dev/tests/unit/button/button_events.js
=======================================
--- /branches/dev/tests/unit/button/button.html    Sun Jan 3 10:09:25 2010
+++ /branches/dev/tests/unit/button/button.html    Sun Jan 3 17:44:34 2010
@@ -25,7 +25,7 @@
<div id="main">
-    <div><button id="button">Label</button></div>
+    <div><button id="button" class="foo">Label</button></div>
    <div id="radio0" style="margin-top: 2em;">
        <input type="radio" id="radio01" name="radio" checked="checked" /><label
for="radio01">Choice 1</label>
=======================================
--- /branches/dev/tests/unit/button/button_core.js    Sun Jan 3 10:09:25 2010
+++ /branches/dev/tests/unit/button/button_core.js    Sun Jan 3 17:44:34 2010
@@ -13,21 +13,21 @@
    ok( $("#radio2 .ui-button" + form2).is(".ui-state-active") );
}
-test("radio, no form", function() {
+test("radio groups", function() {
    $(":radio").button();
-    assert(":first", ":eq(1)", ":last");
-    $("#radio0 .ui-button:first").click();
-    assert(":first", ":eq(1)", ":last");
-});
-
-test("radio, form", function() {
-    $(":radio").button();
-    assert(":first", ":eq(1)", ":last");
-    $("#radio1 .ui-button:first").click();
-    assert(":first", ":first", ":last");
-
-    $("#radio2 .ui-button:first").click();
-    assert(":first", ":first", ":first");
+    assert(":eq(0)", ":eq(1)", ":eq(2)");
+
+    // click outside of forms
+    $("#radio0 .ui-button:eq(1)").click();
+    assert(":eq(1)", ":eq(1)", ":eq(2)");
+
+    // click in first form
+    $("#radio1 .ui-button:eq(0)").click();
+    assert(":eq(1)", ":eq(0)", ":eq(2)");
+
+    // click in second form
+    $("#radio2 .ui-button:eq(0)").click();
+    assert(":eq(1)", ":eq(0)", ":eq(0)");
});
})(jQuery);
=======================================
--- /branches/dev/tests/unit/button/button_events.js    Sun Jan 3 10:09:25
2010
+++ /branches/dev/tests/unit/button/button_events.js    Sun Jan 3 17:44:34
2010
@@ -10,7 +10,7 @@
    var set = $("#radio1").buttonset();
    set.find("input:first").click(function() {
        ok( true );
-    })
+    });
    ok( set.find("label:first").click().is(".ui-button") );
});
--