]> source.dussan.org Git - jquery-ui.git/commitdiff
progressbar unit tests: split tests into individual files
authorRichard Worth <rdworth@gmail.com>
Wed, 4 Feb 2009 04:39:31 +0000 (04:39 +0000)
committerRichard Worth <rdworth@gmail.com>
Wed, 4 Feb 2009 04:39:31 +0000 (04:39 +0000)
tests/unit/progressbar/progressbar.html
tests/unit/progressbar/progressbar.js [deleted file]
tests/unit/progressbar/progressbar_core.js
tests/unit/progressbar/progressbar_defaults.js
tests/unit/progressbar/progressbar_events.js
tests/unit/progressbar/progressbar_methods.js
tests/unit/progressbar/progressbar_options.js
tests/unit/progressbar/progressbar_tickets.js

index 614c4a0e90775aa44955a759facd6896c218d42a..b12ba3f476d013aa28ec24c0a00daef5c60d40ba 100644 (file)
        <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>
 
diff --git a/tests/unit/progressbar/progressbar.js b/tests/unit/progressbar/progressbar.js
deleted file mode 100644 (file)
index 0871065..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * progressbar unit tests
- */
-(function($) {
-//
-// Progressbar Test Helper Functions
-//
-
-var defaults = {
-       disabled: false,
-       value: 0
-};
-
-var el;
-
-// Progressbar Tests
-module("progressbar");
-
-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');
-
-});
-
-test("defaults", function() {
-       el = $('<div></div>').progressbar();
-       $.each(defaults, function(key, val) {
-               var actual = el.data(key + ".progressbar"), expected = val;
-               same(actual, expected, key);
-       });
-       el.remove();
-});
-
-test("set defaults on init", function() {
-       el = $("#progressbar").progressbar({ 
-               value: 50
-       });
-
-       equals(el.progressbar("option", "value"), 50, "value");
-});
-
-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);
index b104ffe38828eb2c71ec7dc2adabf5ff855d3c7a..7e1cafbd5c28a8020c02f43723a351b9fe880c64 100644 (file)
@@ -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);
index 70934818c242e5d1ab6f46e35e36d5d3986fca89..b663708ce06d508f8c761b79763399d3681a6fa8 100644 (file)
@@ -3,7 +3,8 @@
  */
 
 var progressbar_defaults = {
-       disabled: false
+       disabled: false,
+       value: 0
 };
 
 commonWidgetTests('progressbar', { defaults: progressbar_defaults });
index 26f2500ece81e1b4767d34d5e4098013cb44047e..6b73e2e8d4d81353d303ed95ba885eb3748b11f5 100644 (file)
@@ -5,7 +5,7 @@
 
 module("progressbar: events");
 
-test("testname", function() {
+test("change", function() {
        ok(false, "missing test - untested code is broken code.");
 });
 
index 810d33a11c7039833b5ed9fcd3b43a5fec28b2d4..ece100e02f18498747c0d4936763e92f4fd82408 100644 (file)
@@ -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);
index 4699a11e4e39e5a9732de649eb924b1a07d5b271..f6069a5dee600371cee569ea72c8df0027ffd590 100644 (file)
@@ -5,7 +5,7 @@
 
 module("progressbar: options");
 
-test("testname", function() {
+test("{ value : 0 }, default", function() {
        ok(false, "missing test - untested code is broken code.");
 });
 
index 198b0b85201a650fa0e9459028f6a148988e9111..debd626149b3a48a43bd75269ee56e2a582bbb70 100644 (file)
@@ -5,8 +5,4 @@
 
 module("progressbar: tickets");
 
-test("testname", function() {
-       ok(false, "missing test - untested code is broken code.");
-});
-
 })(jQuery);