From 65584c1640f8c7430587738c3c4cd7dd8010a2a5 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 12 Jan 2015 11:23:08 -0500 Subject: Selectmenu: Better handling when there are no options Fixes #10662 Closes gh-1370 Closes gh-1423 --- tests/unit/selectmenu/selectmenu_methods.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/unit/selectmenu/selectmenu_methods.js') 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(), $( " " ).html(), + "Empty button text" ); + equal( menu.children().length, 0, "Empty menu" ); +}); + test( "widget and menuWidget", function() { expect( 4 ); -- cgit v1.2.3