mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-31 05:00:25 +00:00
29 lines
No EOL
824 B
JavaScript
29 lines
No EOL
824 B
JavaScript
/*
|
|
* degradeInputs unit tests
|
|
*/
|
|
|
|
(function($){
|
|
|
|
module('jquery.mobile.slider.js');
|
|
|
|
test('keepNative elements should not be degraded', function() {
|
|
same($('input#not-to-be-degraded').attr("type"), "range");
|
|
});
|
|
|
|
test('should degrade input type to a different type, as specified in page options', function(){
|
|
var degradeInputs = $.mobile.page.prototype.options.degradeInputs;
|
|
|
|
expect( degradeInputs.length );
|
|
|
|
$.each(degradeInputs, function( oldType, newType ) {
|
|
if (newType === false) {
|
|
newType = oldType;
|
|
}
|
|
|
|
$('#test-container').html('<input type="' + oldType + '" />').trigger("create");
|
|
|
|
same($('#test-container input').attr("type"), newType);
|
|
});
|
|
});
|
|
|
|
})(jQuery); |