aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2011-05-02 20:35:58 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2011-05-02 20:35:58 +0200
commit9ea5b5d4e5831526a39bda7a2d45fdfb832038b9 (patch)
tree1553721859fb8dc35872c007c883bd16b14b1e6f /tests
parent5c4709882944fbd9800ecaab79d42cb9e3b5d96c (diff)
downloadjquery-ui-9ea5b5d4e5831526a39bda7a2d45fdfb832038b9.tar.gz
jquery-ui-9ea5b5d4e5831526a39bda7a2d45fdfb832038b9.zip
Fix menu unit tests (regression fron Hans' branch)
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/menu/menu_core.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/unit/menu/menu_core.js b/tests/unit/menu/menu_core.js
index 5b00e17e8..c0feae75c 100644
--- a/tests/unit/menu/menu_core.js
+++ b/tests/unit/menu/menu_core.js
@@ -13,23 +13,26 @@ test("accessibility", function () {
var item0 = $("li:eq(0) a");
ok( ac.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all"), "menu class");
- equals( ac.attr("role"), "listbox", "main role");
+ equals( ac.attr("role"), "menu", "main role");
ok( !ac.attr("aria-activedescendant"), "aria attribute not yet active");
+
var item = ac.find( "li:first" ).find( "a" ).attr( "id", "xid" ).end();
ac.menu( "focus", $.Event(), item );
equals( ac.attr("aria-activedescendant"), "xid", "aria attribute, id from dom");
+
var item = ac.find( "li:last" );
ac.menu( "focus", $.Event(), item );
- equals( ac.attr("aria-activedescendant"), "menu1-activedescendant", "aria attribute, generated id");
+ equals( ac.attr("aria-activedescendant"), "menu1-4", "aria attribute, generated id");
});
test("items class and role", function () {
var ac = $('#menu1').menu();
- expect(1 + 4 * $("li",ac).length);
+ expect(1 + 5 * $("li",ac).length);
ok( ($("li",ac).length > 0 ), "number of menu items");
$("li",ac).each(function(item) {
ok( $(this).hasClass("ui-menu-item"), "menu item ("+ item + ") class for item");
- equals( $(this).attr("role"), "menuitem", "menu item ("+ item + ") role");
+ equals( $(this).attr("role"), "presentation", "menu item ("+ item + ") role");
+ equals( $("a", this).attr("role"), "menuitem", "menu item ("+ item + ") role");
ok( $("a",this).hasClass("ui-corner-all"), "a element class for menu item ("+ item + ") ");
equals( $("a",this).attr("tabindex"), "-1", "a element tabindex for menu item ("+ item + ") ");
});