Skip to content

Commit

Permalink
Selectmenu: split core unit test for state synchronization in keydown…
Browse files Browse the repository at this point in the history
… and click
  • Loading branch information
fnagel committed Jul 16, 2012
1 parent 44f9b8f commit 83f4249
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/unit/selectmenu/selectmenu_core.js
Expand Up @@ -44,8 +44,8 @@ $.each([
selector: "#files"
}
], function( i, settings ) {
test("state synchronization - " + settings.type, function () {
expect(8);
test("state synchronization - after keydown - " + settings.type, function () {
expect(4);

var links,
element = $(settings.selector).selectmenu(),
Expand All @@ -61,6 +61,19 @@ $.each([
equal( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "after keydown selected menu link aria-selected" );
equal( element.find("option:selected").val(), selected.next("option").val() , "after keydown original select state" );
equal( button.text(), selected.next("option").text(), "after keydown button text" );
});

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

var links,
element = $(settings.selector).selectmenu(),
button = element.selectmenu("widget"),
menu = element.selectmenu("menuWidget"),
selected = element.find("option:selected");

button.simulate( "focus" );
links = menu.find("li.ui-menu-item a");

button.simulate( "click" );
menu.find("a").last().simulate( "mouseover" ).trigger( "click" );
Expand Down

0 comments on commit 83f4249

Please sign in to comment.