aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-12-06 09:35:41 -0500
committerScott González <scott.gonzalez@gmail.com>2012-12-06 09:35:41 -0500
commitf1be88e7956fe9114ae20d19242cd8190a6ff399 (patch)
tree5b381155faf947db5ac295888dfbdf8303f43579 /tests
parent8c763cdf9836e9e97432167e92d0a5808e033ba2 (diff)
downloadjquery-ui-f1be88e7956fe9114ae20d19242cd8190a6ff399.tar.gz
jquery-ui-f1be88e7956fe9114ae20d19242cd8190a6ff399.zip
Progressbar: Only remove aria-valuenow for indeterminate progressbars. Added more accessibility tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/progressbar/progressbar_common.js2
-rw-r--r--tests/unit/progressbar/progressbar_core.js10
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/unit/progressbar/progressbar_common.js b/tests/unit/progressbar/progressbar_common.js
index ceee3fbec..0768576f5 100644
--- a/tests/unit/progressbar/progressbar_common.js
+++ b/tests/unit/progressbar/progressbar_common.js
@@ -1,8 +1,8 @@
TestHelpers.commonWidgetTests( "progressbar", {
defaults: {
disabled: false,
- value: 0,
max: 100,
+ value: 0,
//callbacks
change: null,
diff --git a/tests/unit/progressbar/progressbar_core.js b/tests/unit/progressbar/progressbar_core.js
index 0a2ef895b..54a33cc9d 100644
--- a/tests/unit/progressbar/progressbar_core.js
+++ b/tests/unit/progressbar/progressbar_core.js
@@ -1,7 +1,7 @@
module( "progressbar: core" );
test( "accessibility", function() {
- expect( 7 );
+ expect( 11 );
var element = $( "#progressbar" ).progressbar();
equal( element.attr( "role" ), "progressbar", "aria role" );
@@ -12,9 +12,17 @@ test( "accessibility", function() {
element.progressbar( "value", 77 );
equal( element.attr( "aria-valuenow" ), 77, "aria-valuenow" );
+ element.progressbar( "option", "max", 150 );
+ equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
+
element.progressbar( "disable" );
equal( element.attr( "aria-disabled" ), "true", "aria-disabled on" );
element.progressbar( "enable" );
equal( element.attr( "aria-disabled" ), "false", "aria-disabled off" );
+
+ element.progressbar( "option", "value", false );
+ equal( element.attr( "aria-valuemin" ), 0, "aria-valuemin" );
+ equal( element.attr( "aria-valuemax" ), 150, "aria-valuemax" );
+ strictEqual( element.attr( "aria-valuenow" ), undefined, "aria-valuenow initially" );
});