diff --git a/tests/unit/select/index.html b/tests/unit/select/index.html index 7e21c235..0c9da49f 100644 --- a/tests/unit/select/index.html +++ b/tests/unit/select/index.html @@ -239,6 +239,13 @@ + +
+ +
diff --git a/tests/unit/select/select_core.js b/tests/unit/select/select_core.js index cc9d02c4..c750f95b 100644 --- a/tests/unit/select/select_core.js +++ b/tests/unit/select/select_core.js @@ -95,4 +95,33 @@ $.testHelper.sequence(sequence, 1000); }); + module("Non native menus", { + setup: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = false; + }, + teardown: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = true; + } + }); + + asyncTest( "a large select option should not overflow", function(){ + // https://github.com/jquery/jquery-mobile/issues/1338 + var menu, select = $("#select-long-option-label"); + + $.testHelper.sequence([ + function(){ + // bring up the dialog + select.trigger("click"); + }, + + function() { + menu = $(".ui-selectmenu-list"); + + equal(menu.width(), menu.find("li:nth-child(2) .ui-btn-text").width(), "ui-btn-text element should not overflow") + start(); + } + ], 500); + + }); + })(jQuery);