From ed7eb38bdca59a00febf2c3eee6a13f9521dd94b Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Wed, 25 May 2011 13:09:27 -0700 Subject: [PATCH] Issue #1338 Added unit test --- tests/unit/select/index.html | 7 +++++++ tests/unit/select/select_core.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) 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);