Tizen 2.1 base
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.0.1pre / tests / unit / select / select_events.js
1 /*
2  * mobile select unit tests
3  */
4
5 (function($){
6         var libName = "jquery.mobile.forms.select.js";
7
8         $(document).bind('mobileinit', function(){
9                 $.mobile.selectmenu.prototype.options.nativeMenu = false;
10         });
11
12         module(libName,{
13                 setup: function(){
14                         $.testHelper.openPage( location.hash.indexOf("#default") >= 0 ? "#" : "#default" );
15                 }
16         });
17
18         test( "selects marked with data-native-menu=true should use a div as their button", function(){
19                 same($("#select-choice-native-container div.ui-btn").length, 1);
20         });
21
22         test( "selects marked with data-native-menu=true should not have a custom menu", function(){
23                 same($("#select-choice-native-container ul").length, 0);
24         });
25
26         test( "selects marked with data-native-menu=true should sit inside the button", function(){
27                 same($("#select-choice-native-container div.ui-btn select").length, 1);
28         });
29
30         test( "select controls will create when inside a container that receives a 'create' event", function(){
31                 ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-select").length, "did not have enhancements applied" );
32                 ok( $("#enhancetest").trigger("create").find(".ui-select").length, "enhancements applied" );
33         });
34 })(jQuery);