Skip to content
Permalink
Browse files

Selectmenu Tests: check if button text is updated when selected optio…

…n is added
  • Loading branch information...
fnagel committed Aug 31, 2013
1 parent 67f04e4 commit d668c94e3e62750e6277fe1dfb9b5faaabd84d2a
Showing with 6 additions and 2 deletions.
  1. +6 −2 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( "<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 );
});

0 comments on commit d668c94

Please sign in to comment.
You can’t perform that action at this time.