mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-11 09:51:01 +00:00
added select_native test set and a tests to verify that setting the value of the select itself sets button text
This commit is contained in:
parent
58631807d4
commit
f6a5608ae2
3 changed files with 35 additions and 3 deletions
|
|
@ -10,6 +10,7 @@
|
|||
<script src="../../../external/qunit.js"></script>
|
||||
<script src="../../../tests/jquery.testHelper.js"></script>
|
||||
<script src="../../../js"></script>
|
||||
<script src="select_native.js"></script>
|
||||
<script src="select_events.js"></script>
|
||||
<script src="select_core.js"></script>
|
||||
|
||||
|
|
@ -34,6 +35,15 @@
|
|||
</select>
|
||||
</div>
|
||||
|
||||
<div data-nstest-role="fieldcontain" id="native-select-choice-few-container">
|
||||
<select name="native-select-choice-few" id="native-select-choice-few" data-nstest-native-menu="true">
|
||||
<option value="standard">Standard: 7 day</option>
|
||||
<option value="rush">Rush: 3 days</option>
|
||||
<option value="express">Express: next day</option>
|
||||
<option value="overnight">Overnight</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div data-nstest-role="fieldcontain" id="select-choice-native-container">
|
||||
<select name="select-choice-native" id="select-choice-native" data-nstest-native-menu="true">
|
||||
<option value="standard">Standard: 7 day</option>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
(function($){
|
||||
var libName = "jquery.mobile.forms.select.js",
|
||||
originalDefaultDialogTrans = $.mobile.defaultDialogTransition,
|
||||
originalDefTransitionHandler = $.mobile.defaultTransitionHandler,
|
||||
resetHash, closeDialog;
|
||||
originalDefaultDialogTrans = $.mobile.defaultDialogTransition,
|
||||
originalDefTransitionHandler = $.mobile.defaultTransitionHandler,
|
||||
resetHash, closeDialog;
|
||||
|
||||
resetHash = function(timeout){
|
||||
$.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" : "#default" );
|
||||
|
|
|
|||
22
tests/unit/select/select_native.js
Normal file
22
tests/unit/select/select_native.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* mobile select unit tests
|
||||
*/
|
||||
|
||||
(function($){
|
||||
module("jquery.mobile.forms.select native");
|
||||
|
||||
test( "native menu selections alter the button text", function(){
|
||||
var select = $("#native-select-choice-few"), setAndCheck;
|
||||
|
||||
setAndCheck = function(key){
|
||||
var text;
|
||||
|
||||
select.val(key).selectmenu('refresh');
|
||||
text = select.find("option[value='" + key + "']").text();
|
||||
same(select.parent().find(".ui-btn-text").text(), text);
|
||||
};
|
||||
|
||||
setAndCheck('rush');
|
||||
setAndCheck('standard');
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue