aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectmenu
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-01-12 11:23:08 -0500
committerScott González <scott.gonzalez@gmail.com>2015-01-12 13:00:38 -0500
commit65584c1640f8c7430587738c3c4cd7dd8010a2a5 (patch)
treed02d45463f89ffe5aa727e3c6cc6fc84f7cd562e /tests/unit/selectmenu
parent42099e44610face58172ed0ed27115fb2b84ab50 (diff)
downloadjquery-ui-65584c1640f8c7430587738c3c4cd7dd8010a2a5.tar.gz
jquery-ui-65584c1640f8c7430587738c3c4cd7dd8010a2a5.zip
Selectmenu: Better handling when there are no options
Fixes #10662 Closes gh-1370 Closes gh-1423
Diffstat (limited to 'tests/unit/selectmenu')
-rw-r--r--tests/unit/selectmenu/selectmenu_methods.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/selectmenu/selectmenu_methods.js b/tests/unit/selectmenu/selectmenu_methods.js
index ca1b8c6a3..0ff0f95c2 100644
--- a/tests/unit/selectmenu/selectmenu_methods.js
+++ b/tests/unit/selectmenu/selectmenu_methods.js
@@ -154,6 +154,20 @@ test( "refresh - disabled optgroup", function() {
}
});
+test( "refresh - remove all options", function() {
+ expect( 2 );
+
+ var element = $( "#speed" ).selectmenu(),
+ button = element.selectmenu( "widget" ),
+ menu = element.selectmenu( "menuWidget" );
+
+ element.children().remove();
+ element.selectmenu( "refresh" );
+ equal( button.find( ".ui-selectmenu-text" ).html(), $( "<span>&#160;</span>" ).html(),
+ "Empty button text" );
+ equal( menu.children().length, 0, "Empty menu" );
+});
+
test( "widget and menuWidget", function() {
expect( 4 );