diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/progressbar/progressbar_core.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/progressbar/progressbar_core.js b/tests/unit/progressbar/progressbar_core.js index cffd84d21..8f4a138ce 100644 --- a/tests/unit/progressbar/progressbar_core.js +++ b/tests/unit/progressbar/progressbar_core.js @@ -1,5 +1,30 @@ module( "progressbar: core" ); +test( "markup structure", function() { + expect( 5 ); + var element = $( "#progressbar" ).progressbar(); + ok( element.hasClass( "ui-progressbar" ), "main element is .ui-progressbar" ); + ok( !element.hasClass( "ui-progressbar-indeterminate" ), + "main element is not .ui-progressbar-indeterminate" ); + equal( element.children().length, 1, "main element contains one child" ); + ok( element.children().eq( 0 ).hasClass( "ui-progressbar-value" ), + "child is .ui-progressbar-value" ); + equal( element.children().children().length, 0, "no overlay div" ); +}); + +test( "markup structure - indeterminate", function() { + expect( 5 ); + var element = $( "#progressbar" ).progressbar({ value: false }); + ok( element.hasClass( "ui-progressbar" ), "main element is .ui-progressbar" ); + ok( element.hasClass( "ui-progressbar-indeterminate" ), + "main element is .ui-progressbar-indeterminate" ); + equal( element.children().length, 1, "main element contains one child" ); + ok( element.children().eq( 0 ).hasClass( "ui-progressbar-value" ), + "child is .ui-progressbar-value" ); + equal( element.children().children( ".ui-progressbar-overlay" ).length, 1, + ".ui-progressbar-value has .ui-progressbar-overlay" ); +}); + test( "accessibility", function() { expect( 11 ); var element = $( "#progressbar" ).progressbar(); |