aboutsummaryrefslogtreecommitdiffstats
path: root/tests/progressbar.js
blob: e95f17a809d32a5fe2b7004966112fee92ca6f2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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);