jquery-ui/tests/unit/progressbar/progressbar_events.js
2012-05-25 23:10:46 -04:00

44 lines
937 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module( "progressbar: events" );
test( "create", function() {
expect( 1 );
$( "#progressbar" ).progressbar({
value: 5,
create: function() {
deepEqual( 5, $( this ).progressbar( "value" ) );
},
change: function() {
ok( false, "create() has triggered change()" );
}
});
});
test( "change", function() {
expect( 1 );
$( "#progressbar" ).progressbar({
change: function() {
deepEqual( 5, $( this ).progressbar( "value" ) );
}
}).progressbar( "value", 5 );
});
test( "complete", function() {
expect( 3 );
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" );
}
});
value = 5;
element.progressbar( "value", value );
value = 100;
element.progressbar( "value", value );
});