aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2011-04-09 14:53:15 -0400
committerRichard Worth <rdworth@gmail.com>2011-04-09 14:53:15 -0400
commit7272f3bdef8ebc81cc51d3749fdeb4696eda666a (patch)
tree80b5e90c439e9430a16bf0c769d95df82cacab0b /tests
parent3b77ac654b079a3098d12cca04d2397bb3863b85 (diff)
downloadjquery-ui-7272f3bdef8ebc81cc51d3749fdeb4696eda666a.tar.gz
jquery-ui-7272f3bdef8ebc81cc51d3749fdeb4696eda666a.zip
Progressbar: Added unit test for #7231 - valueDiv should be hidden when value is at 0%
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/progressbar/progressbar_options.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/progressbar/progressbar_options.js b/tests/unit/progressbar/progressbar_options.js
index 70ad7abab..230c939ab 100644
--- a/tests/unit/progressbar/progressbar_options.js
+++ b/tests/unit/progressbar/progressbar_options.js
@@ -10,6 +10,23 @@ test("{ value : 0 }, default", function() {
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