From 8b3e57024138f1a40be762fd5d29cc390129a8ad Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Mon, 5 Nov 2012 18:37:48 +0100 Subject: Menu: Look into submenus for uninitialized menu items. Fixes #8773 - Menu: refresh() doesn't refresh existing submenus. --- tests/unit/menu/menu_methods.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js index c49783c3e..a7e78ea69 100644 --- a/tests/unit/menu/menu_methods.js +++ b/tests/unit/menu/menu_methods.js @@ -60,6 +60,15 @@ test( "refresh", function() { equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" ); }); +test( "refresh submenu", function() { + expect( 2 ); + var element = $( "#menu2" ).menu(); + equal( element.find( "ul:first .ui-menu-item" ).length, 3 ); + element.find( "ul" ).andSelf().append( "
  • New Item
  • " ); + element.menu("refresh"); + equal( element.find( "ul:first .ui-menu-item" ).length, 4 ); +}); + test( "widget", function() { expect( 2 ); var element = $( "#menu1" ).menu(), -- cgit v1.2.3