mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Progressbar: Added unit test for #7231 - valueDiv should be hidden when value is at 0%
(cherry picked from commit 7272f3bdef
)
This commit is contained in:
parent
3c13b33682
commit
9412777c4b
@ -10,6 +10,23 @@ test("{ value : 0 }, default", function() {
|
|||||||
same( 0, $("#progressbar").progressbar("value") );
|
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() {
|
test("{ value : 5 }", function() {
|
||||||
$("#progressbar").progressbar({
|
$("#progressbar").progressbar({
|
||||||
value: 5
|
value: 5
|
||||||
|
Loading…
Reference in New Issue
Block a user