diff options
author | Felix Nagel <info@felixnagel.com> | 2012-01-13 19:49:42 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-01-13 19:49:42 +0100 |
commit | 5766261af2767862ab6750e5eb8d6a927ced50ae (patch) | |
tree | 669ae6a69074c59a53e84a33cebd94ddf4d5d531 /tests/unit/selectmenu/selectmenu_core.js | |
parent | 6c049f2f9a6716a81ea7e0f9ee67362e61c397cb (diff) | |
download | jquery-ui-5766261af2767862ab6750e5eb8d6a927ced50ae.tar.gz jquery-ui-5766261af2767862ab6750e5eb8d6a927ced50ae.zip |
Selectmenu: fix unit tests (with clean-up)
Diffstat (limited to 'tests/unit/selectmenu/selectmenu_core.js')
-rw-r--r-- | tests/unit/selectmenu/selectmenu_core.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/unit/selectmenu/selectmenu_core.js b/tests/unit/selectmenu/selectmenu_core.js index 51ba00c1c..f06f65c99 100644 --- a/tests/unit/selectmenu/selectmenu_core.js +++ b/tests/unit/selectmenu/selectmenu_core.js @@ -3,13 +3,15 @@ module( "selectmenu: core" ); test("accessibility", function () { - var element = $('#speed').selectmenu(); - var widget = element.selectmenu("widget"); - var button = widget.filter(".ui-selectmenu-button"); - var menu = widget.filter(".ui-selectmenu-menu"); - var link = button.children("a"); - var ul = menu.children("ul") - var links = ul.find("li.ui-menu-item a"); + var element = $('#speed').selectmenu(), + widget = element.selectmenu("widget"), + button = widget.filter(".ui-selectmenu-button"), + menu = widget.filter(".ui-selectmenu-menu"), + link = button.find("a"), + selected = element.find("option:selected"), + ul = menu.children("ul"), + links = ul.find("li.ui-menu-item a"); + expect(9 + links.length * 2); equals( "true", link.attr("aria-haspopup"), "button link aria-haspopup" ); @@ -41,12 +43,13 @@ $.each([ ], function( i, settings ) { test("state synchronization - " + settings.type, function () { expect(5); - var element = $(settings.selector).selectmenu(); - var widget = element.selectmenu("widget"); - var button = widget.filter(".ui-selectmenu-button"); - var menu = widget.filter(".ui-selectmenu-menu"); - var link = button.find("a"); - var selected = element.find("option:selected"); + + var element = $(settings.selector).selectmenu(), + widget = element.selectmenu("widget"), + button = widget.filter(".ui-selectmenu-button"), + menu = widget.filter(".ui-selectmenu-menu"), + link = button.find("a"), + selected = element.find("option:selected"); equals( button.text(), selected.text(), "inital button text" ); |