2009-02-02 14:36:08 +00:00
|
|
|
/*
|
|
|
|
* progressbar_events.js
|
|
|
|
*/
|
|
|
|
(function($) {
|
|
|
|
|
|
|
|
module("progressbar: events");
|
|
|
|
|
2010-11-22 13:49:47 +00:00
|
|
|
test("create", function() {
|
|
|
|
expect(1);
|
|
|
|
$("#progressbar").progressbar({
|
|
|
|
value: 5,
|
|
|
|
create: function() {
|
2012-02-28 14:56:32 +00:00
|
|
|
deepEqual(5, $(this).progressbar("value") );
|
2010-11-22 13:49:47 +00:00
|
|
|
},
|
|
|
|
change: function() {
|
|
|
|
ok(false, 'create() has triggered change()');
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
2009-02-04 04:39:31 +00:00
|
|
|
test("change", function() {
|
2009-09-11 18:47:34 +00:00
|
|
|
expect(1);
|
|
|
|
$("#progressbar").progressbar({
|
|
|
|
change: function() {
|
2012-02-28 14:56:32 +00:00
|
|
|
deepEqual( 5, $(this).progressbar("value") );
|
2009-09-11 18:47:34 +00:00
|
|
|
}
|
|
|
|
}).progressbar("value", 5);
|
2009-02-02 14:36:08 +00:00
|
|
|
});
|
|
|
|
|
2010-09-27 14:44:04 +00:00
|
|
|
test( "complete", function() {
|
|
|
|
expect( 3 );
|
|
|
|
var changes = 0,
|
|
|
|
value;
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2010-09-27 14:44:04 +00:00
|
|
|
$( "#progressbar" ).progressbar({
|
|
|
|
change: function() {
|
|
|
|
changes++;
|
2012-02-28 14:56:32 +00:00
|
|
|
deepEqual( $( this ).progressbar( "value" ), value, "change at " + value );
|
2010-09-27 14:44:04 +00:00
|
|
|
},
|
|
|
|
complete: function() {
|
|
|
|
equal( changes, 2, "complete triggered after change" );
|
|
|
|
}
|
|
|
|
});
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2010-09-27 14:44:04 +00:00
|
|
|
value = 5;
|
|
|
|
$( "#progressbar" ).progressbar( "value", value );
|
|
|
|
value = 100;
|
|
|
|
$( "#progressbar" ).progressbar( "value", value );
|
|
|
|
});
|
|
|
|
|
2009-02-02 14:36:08 +00:00
|
|
|
})(jQuery);
|