Tizen 2.1 base
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.0.1pre / tests / unit / degradeInputs / degradeInputs.js
1 /*
2  * degradeInputs unit tests
3  */
4
5 (function($){
6     
7     module('jquery.mobile.slider.js');
8         
9         test('keepNative elements should not be degraded', function() {
10         same($('input#not-to-be-degraded').attr("type"), "range");
11         });
12         
13         test('should degrade input type to a different type, as specified in page options', function(){
14         var degradeInputs = $.mobile.page.prototype.options.degradeInputs;
15     
16         expect( degradeInputs.length );
17     
18         $.each(degradeInputs, function( oldType, newType ) {
19             if (newType === false) {
20                 newType = oldType;
21             }
22             
23             $('#test-container').html('<input type="' + oldType + '" />').trigger("create");
24             
25             same($('#test-container input').attr("type"), newType);
26         });
27     });
28         
29 })(jQuery);