Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #1338

Added unit test
  • Loading branch information...
commit ed7eb38bdca59a00febf2c3eee6a13f9521dd94b 1 parent 37a180a
@gseguin authored
Showing with 36 additions and 0 deletions.
  1. +7 −0 tests/unit/select/index.html
  2. +29 −0 tests/unit/select/select_core.js
View
7 tests/unit/select/index.html
@@ -239,6 +239,13 @@ <h2 id="qunit-userAgent"></h2>
<option value="overnight">Overnight</option>
</select>
</div>
+
+ <div data-nstest-role="fieldcontain" id="select-long-option-label-container">
+ <select name="select-long-option-label" id="select-long-option-label">
+ <option value="short">Choice 1</option>
+ <option value="long">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</option>
+ </select>
+ </div>
</div>
</body>
</html>
View
29 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);
Please sign in to comment.
Something went wrong with that request. Please try again.