Skip to content

Commit

Permalink
whitespace in degradeInputs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Dec 9, 2011
1 parent c49eac6 commit def90bf
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions tests/unit/degradeInputs/degradeInputs.js
Expand Up @@ -3,35 +3,33 @@
*/

(function($){

module('jquery.mobile.slider.js');

module('jquery.mobile.slider.js');

test('keepNative elements should not be degraded', function() {
same($('input#not-to-be-degraded').attr("type"), "range");
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 );

// Initialize dialog page
$.mobile.changePage($('#dialog'));
$.mobile.changePage($('#page'));

$.each(degradeInputs, function( oldType, newType ) {
if (newType === false) {
newType = oldType;
}

$('#page-test-container').html('<input type="' + oldType + '" />').trigger("create");

same($('#page-test-container input').attr("type"), newType);

$('#dialog-test-container').html('<input type="' + oldType + '" />').trigger("create");

same($('#dialog-test-container input').attr("type"), newType);
});
});

var degradeInputs = $.mobile.page.prototype.options.degradeInputs;

expect( degradeInputs.length );

// Initialize dialog page
$.mobile.changePage($('#dialog'));
$.mobile.changePage($('#page'));

$.each(degradeInputs, function( oldType, newType ) {
if (newType === false) {
newType = oldType;
}

$('#page-test-container').html('<input type="' + oldType + '" />').trigger("create");

same($('#page-test-container input').attr("type"), newType);

$('#dialog-test-container').html('<input type="' + oldType + '" />').trigger("create");

same($('#dialog-test-container input').attr("type"), newType);
});
});
})(jQuery);

0 comments on commit def90bf

Please sign in to comment.