aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/progressbar/progressbar_events.js
blob: 22b301abe03c9515faa0a3a83cfde66a34c38b19 (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
/*
 * progressbar_events.js
 */
(function($) {

module("progressbar: events");

test("change", function() {
	expect(1);
	$("#progressbar").progressbar({
		change: function() {
			same( 5, $(this).progressbar("value") );
		}
	}).progressbar("value", 5);
});

test( "complete", function() {
	expect( 3 );
	var changes = 0,
		value;
	
	$( "#progressbar" ).progressbar({
		change: function() {
			changes++;
			same( $( this ).progressbar( "value" ), value, "change at " + value );
		},
		complete: function() {
			equal( changes, 2, "complete triggered after change" );
		}
	});
	
	value = 5;
	$( "#progressbar" ).progressbar( "value", value );
	value = 100;
	$( "#progressbar" ).progressbar( "value", value );
});

})(jQuery);