diff options
author | Felix Nagel <info@felixnagel.com> | 2011-12-22 03:07:18 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2011-12-22 03:07:18 +0100 |
commit | 8e27345e5a1210587038df2d7ec94cc055ee65e6 (patch) | |
tree | 4b5a98b051bf1401cd3e21bc056ceeaa1c137f41 | |
parent | 6d0c7d8e88361bc5605950aa925316d37a42d89b (diff) | |
download | jquery-ui-8e27345e5a1210587038df2d7ec94cc055ee65e6.tar.gz jquery-ui-8e27345e5a1210587038df2d7ec94cc055ee65e6.zip |
Selectmenu: improved a11y unit test
-rw-r--r-- | tests/unit/selectmenu/selectmenu_core.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/unit/selectmenu/selectmenu_core.js b/tests/unit/selectmenu/selectmenu_core.js index e19fefeea..dea3f5d8a 100644 --- a/tests/unit/selectmenu/selectmenu_core.js +++ b/tests/unit/selectmenu/selectmenu_core.js @@ -10,17 +10,24 @@ test("accessibility", function () { var link = button.children("a"); var ul = menu.children("ul") var links = ul.find("li.ui-menu-item a"); - expect(6 + links.length); + expect(12 + links.length * 2); equals( button.attr("aria-disabled"), "false", "button aria-disabled" ); equals( link.attr("aria-disabled"), "false", "button link aria-disabled" ); equals( link.attr("aria-haspopup"), "true", "button link aria-haspopup" ); equals( link.attr("role"), "button", "button link role" ); equals( link.attr("aria-owns"), ul.attr("id"), "button link aria-owns" ); - equals( link.attr("tabindex"), 0, "button link tabindex" ); - + equals( link.attr("tabindex"), 0, "button link tabindex" ); + + equals( ul.attr("aria-hidden"), "true", "menu aria-hidden" ); + equals( ul.attr("aria-disabled"), "false", "menu aria-disabled" ); + equals( ul.attr("aria-labelledby"), link.attr("id"), "menu aria-labelledby" ); + equals( ul.attr("role"), "menubox", "menu role" ); + equals( ul.attr("tabindex"), 0, "menu tabindex" ); + equals( ul.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "menu aria-activedescendant" ); $.each( links, function(index){ equals( $(this).attr("role"), "option", "menu link #" + index +" role" ); + equals( $(this).attr("tabindex"), -1, "menu link #" + index +" tabindex" ); }); }); |