2011-01-16 07:15:17 +00:00
|
|
|
/*
|
|
|
|
|
* mobile select unit tests
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
(function($){
|
2011-03-29 16:32:10 +00:00
|
|
|
var libName = "jquery.mobile.forms.select.js";
|
2011-01-16 07:15:17 +00:00
|
|
|
|
2011-03-26 04:37:45 +00:00
|
|
|
$(document).bind('mobileinit', function(){
|
|
|
|
|
$.mobile.selectmenu.prototype.options.nativeMenu = false;
|
|
|
|
|
});
|
|
|
|
|
|
2011-08-02 01:07:28 +00:00
|
|
|
module(libName,{
|
|
|
|
|
setup: function(){
|
|
|
|
|
$.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" : "#default" );
|
|
|
|
|
}
|
2011-01-27 05:20:40 +00:00
|
|
|
});
|
2011-03-13 06:52:44 +00:00
|
|
|
|
2011-02-02 05:57:34 +00:00
|
|
|
test( "selects marked with data-native-menu=true should use a div as their button", function(){
|
|
|
|
|
same($("#select-choice-native-container div.ui-btn").length, 1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test( "selects marked with data-native-menu=true should not have a custom menu", function(){
|
|
|
|
|
same($("#select-choice-native-container ul").length, 0);
|
|
|
|
|
});
|
2011-03-13 06:52:44 +00:00
|
|
|
|
2011-02-02 05:59:54 +00:00
|
|
|
test( "selects marked with data-native-menu=true should sit inside the button", function(){
|
|
|
|
|
same($("#select-choice-native-container div.ui-btn select").length, 1);
|
|
|
|
|
});
|
2011-08-02 01:07:28 +00:00
|
|
|
|
2011-07-22 13:05:55 +00:00
|
|
|
test( "select controls will create when inside a container that receives a 'create' event", function(){
|
2011-07-20 13:35:48 +00:00
|
|
|
ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-select").length, "did not have enhancements applied" );
|
2011-07-22 13:05:55 +00:00
|
|
|
ok( $("#enhancetest").trigger("create").find(".ui-select").length, "enhancements applied" );
|
2011-07-20 13:35:48 +00:00
|
|
|
});
|
2011-03-29 16:32:10 +00:00
|
|
|
})(jQuery);
|