diff options
author | Felix Nagel <info@felixnagel.com> | 2012-07-16 21:31:18 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-07-16 21:31:18 +0200 |
commit | 83f424972308b533846bd6511495881b9e8a534b (patch) | |
tree | 251b4a57ade1d18264e4112449144c91e995d0f1 | |
parent | 44f9b8fb09dacaa425503ba9b35069dc5ec0591f (diff) | |
download | jquery-ui-83f424972308b533846bd6511495881b9e8a534b.tar.gz jquery-ui-83f424972308b533846bd6511495881b9e8a534b.zip |
Selectmenu: split core unit test for state synchronization in keydown and click
-rw-r--r-- | tests/unit/selectmenu/selectmenu_core.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/unit/selectmenu/selectmenu_core.js b/tests/unit/selectmenu/selectmenu_core.js index 40f37e740..29cd9df43 100644 --- a/tests/unit/selectmenu/selectmenu_core.js +++ b/tests/unit/selectmenu/selectmenu_core.js @@ -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(), @@ -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" ); |