Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Issue #1338
Browse files Browse the repository at this point in the history
Added unit test
  • Loading branch information
Ghislain Seguin committed May 25, 2011
1 parent c9feaf9 commit a4694e3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/select/index.html
Expand Up @@ -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>
29 changes: 29 additions & 0 deletions tests/unit/select/select_core.js
Expand Up @@ -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);

0 comments on commit a4694e3

Please sign in to comment.