summaryrefslogtreecommitdiff
path: root/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_methods.js
blob: a48fa3d4705c83b5df5e6eaa5115405224be6eea (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
/*
 * progressbar_methods.js
 */
(function($) {

module("progressbar: methods");

test("init", function() {
	expect(1);

	$("<div></div>").appendTo('body').progressbar().remove();
	ok(true, '.progressbar() called on element');

});

test("destroy", function() {
	expect(2);

	$("<div></div>").appendTo('body').progressbar().progressbar("destroy").remove();
	ok(true, '.progressbar("destroy") called on element');

	var expected = $('<div></div>').progressbar(),
		actual = expected.progressbar('destroy');
	equals(actual, expected, 'destroy is chainable');
});

test('value', function() {
	expect(3);
	
	var el = $('<div></div>').progressbar({ value: 20 });
	equals(el.progressbar('value'), 20, 'correct value as getter');
	equals(el.progressbar('value', 30), el, 'chainable as setter');
	equals(el.progressbar('option', 'value'), 30, 'correct value after setter');
});

})(jQuery);