diff options
author | Richard Worth <rdworth@gmail.com> | 2008-11-12 02:52:31 +0000 |
---|---|---|
committer | Richard Worth <rdworth@gmail.com> | 2008-11-12 02:52:31 +0000 |
commit | e47820f6ea7810569684464c3a3b02eda5d9604d (patch) | |
tree | adb2aba03fe9d7736ac72118b754101e696f37fa /tests/progressbar.js | |
parent | 7d946ec774e7fd832c0c691076338eae69e9b894 (diff) | |
download | jquery-ui-e47820f6ea7810569684464c3a3b02eda5d9604d.tar.gz jquery-ui-e47820f6ea7810569684464c3a3b02eda5d9604d.zip |
tests: cleanup and consistency with defaults tests
Diffstat (limited to 'tests/progressbar.js')
-rw-r--r-- | tests/progressbar.js | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/tests/progressbar.js b/tests/progressbar.js index 98f437901..d58aaacc4 100644 --- a/tests/progressbar.js +++ b/tests/progressbar.js @@ -2,14 +2,28 @@ * progressbar unit tests */ (function($) { - -// Spinner Tests +// +// Progressbar Test Helper Functions +// + +var defaults = { + disabled: false, + duration: 1000, + increment: 1, + interval: 1000, + range: true, + width: 300 +}; + +var el; + +// Progressbar Tests module("progressbar"); test("init", function() { expect(1); - el = $("#progressbar").progressbar(); + $("<div></div>").appendTo('body').progressbar().remove(); ok(true, '.progressbar() called on element'); }); @@ -17,21 +31,18 @@ test("init", function() { test("destroy", function() { expect(1); - $("#progressbar").progressbar().progressbar("destroy"); + $("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove(); ok(true, '.progressbar("destroy") called on element'); }); test("defaults", function() { - expect(5); - el = $("#progressbar").progressbar(); - - equals(el.data("width.progressbar"), 300, "width"); - equals(el.data("duration.progressbar"), 1000, "duration"); - equals(el.data("interval.progressbar"), 1000, "interval"); - equals(el.data("increment.progressbar"), 1, "increment"); - equals(el.data("range.progressbar"), true, "range"); - + 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() { |