From d668c94e3e62750e6277fe1dfb9b5faaabd84d2a Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 31 Aug 2013 03:10:52 +0200 Subject: [PATCH] Selectmenu Tests: check if button text is updated when selected option is added --- tests/unit/selectmenu/selectmenu_methods.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/selectmenu/selectmenu_methods.js b/tests/unit/selectmenu/selectmenu_methods.js index a4b4fabbe..f2b56e835 100644 --- a/tests/unit/selectmenu/selectmenu_methods.js +++ b/tests/unit/selectmenu/selectmenu_methods.js @@ -69,7 +69,7 @@ test( "refresh - structure", function () { }); asyncTest( "refresh - change selected option", function () { - expect( 3 ); + expect( 4 ); var element = $( "#speed" ).selectmenu(), button = element.selectmenu( "widget" ); @@ -83,9 +83,13 @@ asyncTest( "refresh - change selected option", function () { element[ 0 ].selectedIndex = 0; element.selectmenu( "refresh" ); - equal( element.find( "option:selected" ).text(), button.text(), "button text after changing selected option" ); + element.find( "option" ).removeAttr( "selected" ); + element.prepend( "" ); + element.selectmenu( "refresh" ); + equal( element.find( "option:selected" ).text(), button.text(), "button text after adding selected option" ); + start(); }, 1 ); }); -- 2.39.5