mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu Tests: check if button text is updated when selected option is added
This commit is contained in:
parent
67f04e4e42
commit
d668c94e3e
@ -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 );
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user