jquery-ui/tests/unit/progressbar/progressbar_methods.js

26 lines
795 B
JavaScript
Raw Normal View History

2012-05-26 03:10:46 +00:00
module( "progressbar: methods" );
2012-05-26 03:10:46 +00:00
test( "destroy", function() {
expect( 1 );
domEqual( "#progressbar", function() {
$( "#progressbar" ).progressbar().progressbar( "destroy" );
});
});
2012-05-26 03:10:46 +00:00
test( "value", function() {
expect( 3 );
2012-05-26 03:10:46 +00:00
var element = $( "<div>" ).progressbar({ value: 20 });
equal( element.progressbar( "value" ), 20, "correct value as getter" );
equal( element.progressbar( "value", 30), element, "chainable as setter" );
equal( element.progressbar( "option", "value" ), 30, "correct value after setter" );
});
test( "widget", function() {
expect( 2 );
var element = $( "#progressbar" ).progressbar(),
widgetElement = element.progressbar( "widget" );
equal( widgetElement.length, 1, "one element" );
strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" );
});