r1987 - trunk/tests/unit/progressbar

r1987 - trunk/tests/unit/progressbar


Author: rdworth
Date: Tue Feb 3 20:39:31 2009
New Revision: 1987
Removed:
trunk/tests/unit/progressbar/progressbar.js
Modified:
trunk/tests/unit/progressbar/progressbar.html
trunk/tests/unit/progressbar/progressbar_core.js
trunk/tests/unit/progressbar/progressbar_defaults.js
trunk/tests/unit/progressbar/progressbar_events.js
trunk/tests/unit/progressbar/progressbar_methods.js
trunk/tests/unit/progressbar/progressbar_options.js
trunk/tests/unit/progressbar/progressbar_tickets.js
Log:
progressbar unit tests: split tests into individual files
Modified: trunk/tests/unit/progressbar/progressbar.html
==============================================================================
--- trunk/tests/unit/progressbar/progressbar.html    (original)
+++ trunk/tests/unit/progressbar/progressbar.html    Tue Feb 3 20:39:31 2009
@@ -12,7 +12,12 @@
    <script type="text/javascript"
src="../../../external/qunit/testrunner.js"></script>
    <script type="text/javascript"
src="../../../external/simulate/jquery.simulate.js"></script>
-    <script type="text/javascript" src="progressbar.js"></script>
+    <script type="text/javascript" src="progressbar_core.js"></script>
+    <script type="text/javascript" src="progressbar_defaults.js"></script>
+    <script type="text/javascript" src="progressbar_events.js"></script>
+    <script type="text/javascript" src="progressbar_methods.js"></script>
+    <script type="text/javascript" src="progressbar_options.js"></script>
+    <script type="text/javascript" src="progressbar_tickets.js"></script>
</head>
<body>
Modified: trunk/tests/unit/progressbar/progressbar_core.js
==============================================================================
--- trunk/tests/unit/progressbar/progressbar_core.js    (original)
+++ trunk/tests/unit/progressbar/progressbar_core.js    Tue Feb 3 20:39:31
2009
@@ -1,12 +1,27 @@
/*
* progressbar_core.js
*/
+
+var el;
+
(function($) {
module("progressbar: core");
-test("testname", function() {
-    ok(false, "missing test - untested code is broken code.");
+test("accessibility", function() {
+    expect(7);
+    el = $("#progressbar").progressbar();
+
+    equals(el.attr("role"), "progressbar", "aria role");
+    equals(el.attr("aria-valuemin"), 0, "aria-valuemin");
+    equals(el.attr("aria-valuemax"), 100, "aria-valuemax");
+    equals(el.attr("aria-valuenow"), 0, "aria-valuenow initially");
+    el.progressbar("value", 77);
+    equals(el.attr("aria-valuenow"), 77, "aria-valuenow");
+    el.progressbar("disable");
+    equals(el.attr("aria-disabled"), "true", "aria-disabled");
+    el.progressbar("enable");
+    equals(el.attr("aria-disabled"), "false", "enabled");
});
})(jQuery);
Modified: trunk/tests/unit/progressbar/progressbar_defaults.js
==============================================================================
--- trunk/tests/unit/progressbar/progressbar_defaults.js    (original)
+++ trunk/tests/unit/progressbar/progressbar_defaults.js    Tue Feb 3
20:39:31 2009
@@ -3,7 +3,8 @@
*/
var progressbar_defaults = {
-    disabled: false
+    disabled: false,
+    value: 0
};
commonWidgetTests('progressbar', { defaults: progressbar_defaults });
Modified: trunk/tests/unit/progressbar/progressbar_events.js
==============================================================================
--- trunk/tests/unit/progressbar/progressbar_events.js    (original)
+++ trunk/tests/unit/progressbar/progressbar_events.js    Tue Feb 3 20:39:31
2009
@@ -5,7 +5,7 @@
module("progressbar: events");
-test("testname", function() {
+test("change", function() {
    ok(false, "missing test - untested code is broken code.");
});
Modified: trunk/tests/unit/progressbar/progressbar_methods.js
==============================================================================
--- trunk/tests/unit/progressbar/progressbar_methods.js    (original)
+++ trunk/tests/unit/progressbar/progressbar_methods.js    Tue Feb 3 20:39:31
2009
@@ -5,8 +5,20 @@
module("progressbar: methods");
-test("testname", function() {
-    ok(false, "missing test - untested code is broken code.");
+test("init", function() {
+    expect(1);
+
+    $("<div></div>").appendTo('body').progressbar().remove();
+    ok(true, '.progressbar() called on element');
+
+});
+
+test("destroy", function() {
+    expect(1);
+
+    
$("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove();
+    ok(true, '.progressbar("destroy") called on element');
+
});
})(jQuery);
Modified: trunk/tests/unit/progressbar/progressbar_options.js
==============================================================================
--- trunk/tests/unit/progressbar/progressbar_options.js    (original)
+++ trunk/tests/unit/progressbar/progressbar_options.js    Tue Feb 3 20:39:31
2009
@@ -5,7 +5,7 @@
module("progressbar: options");
-test("testname", function() {
+test("{ value : 0 }, default", function() {
    ok(false, "missing test - untested code is broken code.");
});
Modified: trunk/tests/unit/progressbar/progressbar_tickets.js
==============================================================================
--- trunk/tests/unit/progressbar/progressbar_tickets.js    (original)
+++ trunk/tests/unit/progressbar/progressbar_tickets.js    Tue Feb 3 20:39:31
2009
@@ -5,8 +5,4 @@
module("progressbar: tickets");
-test("testname", function() {
-    ok(false, "missing test - untested code is broken code.");
-});
-
})(jQuery);