Skip to content
Permalink
Browse files

Selectmenu tests: aria-activedescendant für button

  • Loading branch information...
fnagel committed Oct 25, 2012
1 parent b2d50f9 commit e7e73cec07d891fe260c616c833c28d3d4a0402f
Showing with 4 additions and 2 deletions.
  1. +4 −2 tests/unit/selectmenu/selectmenu_core.js
@@ -46,7 +46,7 @@ $.each([
}
], function( i, settings ) {
test("state synchronization - after keydown - " + settings.type, function () {
expect(4);
expect(5);

var links,
element = $(settings.selector).selectmenu(),
@@ -60,12 +60,13 @@ $.each([
button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
equal( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "menu aria-activedescendant" );
equal( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "selected menu link aria-selected" );
equal( button.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "button aria-activedescendant" );
equal( element.find("option:selected").val(), selected.next("option").val() , "original select state" );
equal( button.text(), selected.next("option").text(), "button text" );
});

test("state synchronization - after click - " + settings.type, function () {
expect(4);
expect(5);

var links,
element = $(settings.selector).selectmenu(),
@@ -80,6 +81,7 @@ $.each([
menu.find("a").last().simulate( "mouseover" ).trigger( "click" );
equal( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "menu aria-activedescendant" );
equal( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "selected menu link aria-selected" );
equal( button.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "button aria-activedescendant" );
equal( element.find("option:selected").val(), element.find("option").last().val(), "original select state" );
equal( button.text(), element.find("option").last().text(), "button text" );
});

0 comments on commit e7e73ce

Please sign in to comment.
You can’t perform that action at this time.