diff options
author | Felix Nagel <info@felixnagel.com> | 2013-04-29 20:47:02 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-04-29 20:47:02 +0200 |
commit | c73f7e81ad48fe367cc001d90c306da3ad4ad33a (patch) | |
tree | 30be1b57802659b88324409b808c9363b8cc3bea /tests | |
parent | 4d986a46b50f59b27cae96eec62119fc50c0c73d (diff) | |
download | jquery-ui-c73f7e81ad48fe367cc001d90c306da3ad4ad33a.tar.gz jquery-ui-c73f7e81ad48fe367cc001d90c306da3ad4ad33a.zip |
Selectmenu Tests: cleanup unit tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/selectmenu/selectmenu_common.js | 1 | ||||
-rw-r--r-- | tests/unit/selectmenu/selectmenu_core.js | 54 | ||||
-rw-r--r-- | tests/unit/selectmenu/selectmenu_events.js | 2 |
3 files changed, 45 insertions, 12 deletions
diff --git a/tests/unit/selectmenu/selectmenu_common.js b/tests/unit/selectmenu/selectmenu_common.js index af76aa581..e34dd37fb 100644 --- a/tests/unit/selectmenu/selectmenu_common.js +++ b/tests/unit/selectmenu/selectmenu_common.js @@ -10,6 +10,7 @@ TestHelpers.commonWidgetTests( "selectmenu", { at: "left bottom", collision: "none" }, + // callbacks create: null, change: null, diff --git a/tests/unit/selectmenu/selectmenu_core.js b/tests/unit/selectmenu/selectmenu_core.js index 14b275019..69414f1b2 100644 --- a/tests/unit/selectmenu/selectmenu_core.js +++ b/tests/unit/selectmenu/selectmenu_core.js @@ -15,17 +15,25 @@ test("accessibility", function () { equal( button.attr( "role" ), "combobox", "button link role" ); equal( button.attr( "aria-haspopup" ), "true", "button link aria-haspopup" ); - equal( button.attr( "aria-expanded" ), "false", "button link aria-expanded" ); - equal( button.attr( "aria-autocomplete" ), "list", "button link aria-autocomplete" ); + equal( button.attr( "aria-expanded" ), "false", "button link aria-expanded" ); + equal( button.attr( "aria-autocomplete" ), "list", "button link aria-autocomplete" ); equal( button.attr( "aria-owns" ), menu.attr("id"), "button link aria-owns" ); - equal( button.attr( "aria-labelledby" ), links.eq( element[0].selectedIndex ).attr( "id" ), "button link aria-labelledby" ); + equal( + button.attr( "aria-labelledby" ), + links.eq( element[0].selectedIndex ).attr( "id" ), + "button link aria-labelledby" + ); equal( button.attr( "tabindex" ), 0, "button link tabindex" ); equal( menu.attr( "role" ), "listbox", "menu role" ); equal( menu.attr( "aria-labelledby" ), button.attr( "id" ), "menu aria-labelledby" ); equal( menu.attr( "aria-hidden" ), "true", "menu aria-hidden" ); equal( menu.attr( "tabindex" ), 0, "menu tabindex" ); - equal( menu.attr( "aria-activedescendant" ), links.eq( element[ 0 ].selectedIndex ).attr( "id" ), "menu aria-activedescendant" ); + equal( + menu.attr( "aria-activedescendant" ), + links.eq( element[ 0 ].selectedIndex ).attr( "id" ), + "menu aria-activedescendant" + ); $.each( links, function( index ){ equal( $( this ).attr( "role" ), "option", "menu link #" + index +" role" ); equal( $( this ).attr( "tabindex" ), -1, "menu link #" + index +" tabindex" ); @@ -56,9 +64,21 @@ $.each([ links = menu.find("li.ui-menu-item a"); button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); - equal( menu.attr( "aria-activedescendant" ), links.eq( element[ 0 ].selectedIndex ).attr( "id" ), "menu aria-activedescendant" ); - 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( + menu.attr( "aria-activedescendant" ), + links.eq( element[ 0 ].selectedIndex ).attr( "id" ), + "menu aria-activedescendant" + ); + 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" ); }); @@ -75,13 +95,25 @@ $.each([ button.simulate( "click" ); menu.find( "a" ).last().simulate( "mouseover" ).trigger( "click" ); - equal( menu.attr( "aria-activedescendant" ), links.eq( element[ 0 ].selectedIndex ).attr( "id" ), "menu aria-activedescendant" ); - 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( + menu.attr( "aria-activedescendant" ), + links.eq( element[ 0 ].selectedIndex ).attr( "id" ), + "menu aria-activedescendant" + ); + 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" ); }); - test( "state synchronization - after focus item and keydown on button - " + settings.type, function () { + test( "state synchronization - after focus item and keydown on button - " + settings.type, function () { expect(4); var links, diff --git a/tests/unit/selectmenu/selectmenu_events.js b/tests/unit/selectmenu/selectmenu_events.js index f33e66b25..a5b8163d2 100644 --- a/tests/unit/selectmenu/selectmenu_events.js +++ b/tests/unit/selectmenu/selectmenu_events.js @@ -1,4 +1,4 @@ -(function ($) { +(function ( $ ) { module( "selectmenu: events", { setup: function () { |