2012-05-26 03:10:46 +00:00
|
|
|
|
module( "progressbar: events" );
|
2009-02-02 14:36:08 +00:00
|
|
|
|
|
2012-05-26 03:10:46 +00:00
|
|
|
|
test( "create", function() {
|
|
|
|
|
expect( 1 );
|
|
|
|
|
$( "#progressbar" ).progressbar({
|
2010-11-22 13:49:47 +00:00
|
|
|
|
value: 5,
|
|
|
|
|
create: function() {
|
2012-05-26 03:10:46 +00:00
|
|
|
|
deepEqual( 5, $( this ).progressbar( "value" ) );
|
2010-11-22 13:49:47 +00:00
|
|
|
|
},
|
|
|
|
|
change: function() {
|
2012-05-26 03:10:46 +00:00
|
|
|
|
ok( false, "create() has triggered change()" );
|
2010-11-22 13:49:47 +00:00
|
|
|
|
}
|
2012-04-19 02:46:39 +00:00
|
|
|
|
});
|
2010-11-22 13:49:47 +00:00
|
|
|
|
});
|
|
|
|
|
|
2012-05-26 03:10:46 +00:00
|
|
|
|
test( "change", function() {
|
|
|
|
|
expect( 1 );
|
|
|
|
|
$( "#progressbar" ).progressbar({
|
2009-09-11 18:47:34 +00:00
|
|
|
|
change: function() {
|
2012-05-26 03:10:46 +00:00
|
|
|
|
deepEqual( 5, $( this ).progressbar( "value" ) );
|
2009-09-11 18:47:34 +00:00
|
|
|
|
}
|
2012-05-26 03:10:46 +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 );
|
2012-05-26 03:10:46 +00:00
|
|
|
|
var value,
|
|
|
|
|
changes = 0,
|
|
|
|
|
element = $( "#progressbar" ).progressbar({
|
|
|
|
|
change: function() {
|
|
|
|
|
changes++;
|
|
|
|
|
deepEqual( element.progressbar( "value" ), value, "change at " + value );
|
|
|
|
|
},
|
|
|
|
|
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;
|
2012-05-26 03:10:46 +00:00
|
|
|
|
element.progressbar( "value", value );
|
2010-09-27 14:44:04 +00:00
|
|
|
|
value = 100;
|
2012-05-26 03:10:46 +00:00
|
|
|
|
element.progressbar( "value", value );
|
2010-09-27 14:44:04 +00:00
|
|
|
|
});
|