Skip to content

Commit 0f0c2fa

Browse files
author
Gabriel Schulhof
committed
Unit tests: Custom select: Measure the width of the correct custom select menu.
1 parent 9e29890 commit 0f0c2fa

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tests/unit/select/select_core.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,23 +214,22 @@
214214
ok( $( "#select-choice-inside-popup-menu" ).length === 0, "non-native select inside popup has no generated menu" );
215215
});
216216

217-
asyncTest( "a large select option should not overflow", function(){
217+
asyncTest( "a large select option should not overflow", function() {
218218
// https://github.com/jquery/jquery-mobile/issues/1338
219-
var menu, select;
219+
var menu;
220220

221-
$.testHelper.sequence([
221+
$.testHelper.sequence( [
222222
resetHash,
223223

224-
function(){
225-
select = $("#select-long-option-label");
224+
function() {
226225
// bring up the dialog
227-
select.trigger("click");
226+
$( "#select-long-option-label" ).siblings( "a" ).trigger( "click" );
228227
},
229228

230229
function() {
231-
menu = $(".ui-selectmenu-list");
230+
menu = $( "#select-long-option-label-menu.ui-selectmenu-list" );
232231

233-
equal(menu.width(), menu.find("li:nth-child(2) .ui-btn-text").width(), "ui-btn-text element should not overflow");
232+
equal( menu.outerWidth( true ), menu.find( "li:nth-child(2) a" ).outerWidth( true ), "a element should not overflow" );
234233
start();
235234
}
236235
], 500);

0 commit comments

Comments
 (0)