Skip to content

Commit d668c94

Browse files
committed
Selectmenu Tests: check if button text is updated when selected option is added
1 parent 67f04e4 commit d668c94

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/unit/selectmenu/selectmenu_methods.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test( "refresh - structure", function () {
6969
});
7070

7171
asyncTest( "refresh - change selected option", function () {
72-
expect( 3 );
72+
expect( 4 );
7373

7474
var element = $( "#speed" ).selectmenu(),
7575
button = element.selectmenu( "widget" );
@@ -83,9 +83,13 @@ asyncTest( "refresh - change selected option", function () {
8383

8484
element[ 0 ].selectedIndex = 0;
8585
element.selectmenu( "refresh" );
86-
8786
equal( element.find( "option:selected" ).text(), button.text(), "button text after changing selected option" );
8887

88+
element.find( "option" ).removeAttr( "selected" );
89+
element.prepend( "<option selected value=\"selected_option\">Selected option</option>" );
90+
element.selectmenu( "refresh" );
91+
equal( element.find( "option:selected" ).text(), button.text(), "button text after adding selected option" );
92+
8993
start();
9094
}, 1 );
9195
});

0 commit comments

Comments
 (0)