]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu Tests: check if button text is updated when selected option is added
authorFelix Nagel <info@felixnagel.com>
Sat, 31 Aug 2013 01:10:52 +0000 (03:10 +0200)
committerFelix Nagel <info@felixnagel.com>
Sat, 31 Aug 2013 01:10:52 +0000 (03:10 +0200)
tests/unit/selectmenu/selectmenu_methods.js

index a4b4fabbe3a3081cc05d514401f3655780008aed..f2b56e8350ce40ef359d4d6eb527727e53523250 100644 (file)
@@ -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( "<option selected value=\"selected_option\">Selected option</option>" );
+               element.selectmenu( "refresh" );
+               equal( element.find( "option:selected" ).text(), button.text(), "button text after adding selected option" );
+
                start();
        }, 1 );
 });