aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectmenu
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2014-07-31 12:35:42 +0200
committerScott González <scott.gonzalez@gmail.com>2014-11-04 08:40:15 -0500
commit979373983babce7122d98c4f3919426735555d61 (patch)
treebf3fc790034460b9f555f6c94db54d3a22b01079 /tests/unit/selectmenu
parent809cc0f8d0c07c2be44942b3010bba1f9ce91be8 (diff)
downloadjquery-ui-979373983babce7122d98c4f3919426735555d61.tar.gz
jquery-ui-979373983babce7122d98c4f3919426735555d61.zip
Selectmenu: Copy title attributes
Fixes #10435 Closes gh-1298
Diffstat (limited to 'tests/unit/selectmenu')
-rw-r--r--tests/unit/selectmenu/selectmenu_core.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/unit/selectmenu/selectmenu_core.js b/tests/unit/selectmenu/selectmenu_core.js
index 2ee963043..b4efb80f2 100644
--- a/tests/unit/selectmenu/selectmenu_core.js
+++ b/tests/unit/selectmenu/selectmenu_core.js
@@ -3,15 +3,21 @@
module( "selectmenu: core" );
asyncTest( "accessibility", function() {
- var wrappers,
- element = $( "#speed" ).selectmenu(),
- button = element.selectmenu( "widget" ),
- menu = element.selectmenu( "menuWidget" );
+ var wrappers, button, menu,
+ element = $( "#speed" ).attr( "title", "A demo title" );
+
+ element.find( "option" ).each(function( index ) {
+ $( this ).attr( "title", "A demo title #" + index );
+ });
+
+ element.selectmenu();
+ button = element.selectmenu( "widget" );
+ menu = element.selectmenu( "menuWidget" );
button.simulate( "focus" );
wrappers = menu.find( "li.ui-menu-item .ui-menu-item-wrapper" );
- expect( 12 + wrappers.length * 2 );
+ expect( 13 + wrappers.length * 3 );
setTimeout(function() {
equal( button.attr( "role" ), "combobox", "button role" );
@@ -25,6 +31,7 @@ asyncTest( "accessibility", function() {
"button link aria-labelledby"
);
equal( button.attr( "tabindex" ), 0, "button link tabindex" );
+ equal( button.attr( "title" ), "A demo title", "button title" );
equal( menu.attr( "role" ), "listbox", "menu role" );
equal( menu.attr( "aria-labelledby" ), button.attr( "id" ), "menu aria-labelledby" );
@@ -36,9 +43,10 @@ asyncTest( "accessibility", function() {
"menu aria-activedescendant"
);
$.each( wrappers, function( index ) {
- var link = $( this );
- equal( link.attr( "role" ), "option", "menu link #" + index +" role" );
- equal( link.attr( "tabindex" ), -1, "menu link #" + index +" tabindex" );
+ var item = $( this );
+ equal( item.attr( "role" ), "option", "menu item #" + index +" role" );
+ equal( item.attr( "tabindex" ), -1, "menu item #" + index +" tabindex" );
+ equal( item.attr( "title" ), "A demo title #" + index, "menu item #" + index + " title" );
});
start();
});