-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Selectmenu: call refresh(): this.menuItems was undefined #1370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,6 +154,39 @@ test( "refresh - disabled optgroup", function() { | |
} | ||
}); | ||
|
||
test( "refresh - empty select", function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is unnecessary. The subsequent test already covers this scenario. |
||
expect( 1 ); | ||
|
||
var element = $( "#emptySelect" ).selectmenu(); | ||
try{ | ||
element.selectmenu( "refresh" ); | ||
ok( true, "refresh empty select without error" ); | ||
}catch(err) { | ||
ok( false, err.message ); | ||
} | ||
}); | ||
|
||
test( "refresh - structure remove all options", function() { | ||
expect( 4 ); | ||
|
||
var element = $( "#speed" ).selectmenu(), | ||
menu = element.selectmenu( "menuWidget" ), | ||
options = element.find( "option" ), | ||
menuItems = menu.find( "li" ).not( ".ui-selectmenu-optgroup" ); | ||
// refresh select with some options | ||
element.selectmenu( "refresh" ); | ||
ok( true, "first refresh ok" ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first |
||
// remove all options and refresh | ||
element.children().remove(); | ||
element.selectmenu( "refresh" ); | ||
ok( true, "refresh empty select ok" ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
//check length for option and menuItems is 0 | ||
options = element.find( "option" ); | ||
menuItems = menu.find( "li" ).not( ".ui-selectmenu-optgroup" ); | ||
equal( options.length, 0, "options length" ); | ||
equal( menuItems.length, 0, "menu item length" ); | ||
}); | ||
|
||
test( "widget and menuWidget", function() { | ||
expect( 4 ); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a tab here.