diff options
author | Leif Johansson <leifj@sunet.se> | 2011-11-25 21:18:19 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-11-25 21:18:19 +0100 |
commit | 3909e6d89e01e4cd8777377c63037896bb95aa2f (patch) | |
tree | 59679df287c2bee55087fb5afb8d42e7f93a44fb /src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js | |
parent | e5f94e9be5017f627c1ccd8c6306c5cc2e200432 (diff) |
new jq layout
Diffstat (limited to 'src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js')
-rw-r--r-- | src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js new file mode 100644 index 0000000..230c939 --- /dev/null +++ b/src/main/webapp/jquery-ui-1.9pre/tests/unit/progressbar/progressbar_options.js @@ -0,0 +1,59 @@ +/* + * progressbar_options.js + */ +(function($) { + +module("progressbar: options"); + +test("{ value : 0 }, default", function() { + $("#progressbar").progressbar(); + same( 0, $("#progressbar").progressbar("value") ); +}); + +// Ticket #7231 - valueDiv should be hidden when value is at 0% +test( "value: visibility of valueDiv", function() { + expect( 5 ); + var element = $( "#progressbar" ).progressbar({ + value: 0 + }); + ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is initialized at 0" ); + element.progressbar( "value", 1 ); + ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 1" ); + element.progressbar( "value", 100 ); + ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 100" ); + element.progressbar( "value", 0 ); + ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is set to 0" ); + element.progressbar( "value", -1 ); + ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value set to -1 (normalizes to 0)" ); +}); + +test("{ value : 5 }", function() { + $("#progressbar").progressbar({ + value: 5 + }); + same( 5, $("#progressbar").progressbar("value") ); +}); + +test("{ value : -5 }", function() { + $("#progressbar").progressbar({ + value: -5 + }); + same( 0, $("#progressbar").progressbar("value") ); +}); + +test("{ value : 105 }", function() { + $("#progressbar").progressbar({ + value: 105 + }); + same( 100, $("#progressbar").progressbar("value") ); +}); + +test("{ max : 5, value : 10 }", function() { + $("#progressbar").progressbar({ + max: 5, + value: 10 + }); + same( 5, $("#progressbar").progressbar("value") ); +}); + +})(jQuery); |