Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
[custom select unit tests] Add test to make sure focus is transferred…
Browse files Browse the repository at this point in the history
… to a menu item when the menu is opened
  • Loading branch information
Gabriel Schulhof committed Jul 13, 2012
1 parent dcf5c56 commit 56c71b8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/unit/select/select_core.js
Expand Up @@ -177,6 +177,30 @@
], 500);
});

asyncTest( "focus is transferred to a menu item when the menu is opened",function() {
var select, menu, button;

expect( 1 );

$.testHelper.sequence([
function() {
select = $( "#select-choice-focus-test" );
menu = $( "#select-choice-focus-test-menu" );
button = select.find( "a" );
button.trigger( "click" );
},

function() {
ok( menu.find( ":focus" ).length > 0, "item in open select menu has focus" );
select.selectmenu( "close" );
},

function() {
start();
}
], 5000);
});

asyncTest( "using custom refocuses the button after close", function() {
var select, button, triggered = false;

Expand Down

2 comments on commit 56c71b8

@johnbender
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke in phantom.

@jaspermdegroot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabrielschulhof

This test you added fails. Not sure if it's an issue with the test or that the test tells us we need to fix something.

Jasper

Please sign in to comment.