From b4e2e0e9ca4d0993920baba4cc0f50cba4362323 Mon Sep 17 00:00:00 2001 From: Chi Cheng Date: Tue, 19 Aug 2008 06:32:56 +0000 Subject: [PATCH] Progressbar test: init --- tests/all.html | 4 +++ tests/progressbar.html | 39 +++++++++++++++++++++++++++++ tests/progressbar.js | 56 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 tests/progressbar.html create mode 100644 tests/progressbar.js diff --git a/tests/all.html b/tests/all.html index 0080e86f9..518c4b541 100644 --- a/tests/all.html +++ b/tests/all.html @@ -12,6 +12,7 @@ + @@ -27,6 +28,7 @@ + @@ -200,6 +202,8 @@ +
+ \ No newline at end of file diff --git a/tests/progressbar.html b/tests/progressbar.html new file mode 100644 index 000000000..3984bb594 --- /dev/null +++ b/tests/progressbar.html @@ -0,0 +1,39 @@ + + + + jQuery UI Progressbar Test Suite + + + + + + + + + + + + + + + + + + + +

jQuery UI Progressbar Test Suite

+ +

+ +
    + +
    +
    +
    + + + diff --git a/tests/progressbar.js b/tests/progressbar.js new file mode 100644 index 000000000..37d484a22 --- /dev/null +++ b/tests/progressbar.js @@ -0,0 +1,56 @@ +/* + * progressbar unit tests + */ +(function($) { + +// Spinner Tests +module("progressbar"); + +test("init", function() { + expect(1); + + el = $("#progressbar").progressbar(); + ok(true, '.progressbar() called on element'); + +}); + +test("destroy", function() { + expect(1); + + $("#progressbar").progressbar().progressbar("destroy"); + 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"), 3000, "duration"); + equals(el.data("interval.progressbar"), 200, "interval"); + equals(el.data("increment.progressbar"), 1, "increment"); + equals(el.data("range.progressbar"), true, "range"); + +}); + +test("set defaults on init", function() { + expect(5); + el = $("#progressbar").progressbar({ + width: 500, + duration: 5000, + interval: 500, + increment: 5, + range: false + }); + + equals(el.data("width.progressbar"), 500, "width"); + equals(el.data("duration.progressbar"), 5000, "duration"); + equals(el.data("interval.progressbar"), 500, "interval"); + equals(el.data("increment.progressbar"), 5, "increment"); + equals(el.data("range.progressbar"), false, "range"); + +}); + + +})(jQuery);