mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
respect page loading times and comment on assumption in degradeInputs test
This commit is contained in:
parent
def90bf230
commit
5071221291
1 changed files with 24 additions and 16 deletions
|
|
@ -9,27 +9,35 @@
|
|||
same($('input#not-to-be-degraded').attr("type"), "range");
|
||||
});
|
||||
|
||||
test('should degrade input type to a different type, as specified in page options', function(){
|
||||
asyncTest('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'));
|
||||
// NOTE the initial page is already enhanced (or expected to be) so we load the dialog to enhance it
|
||||
// and _expect_ that the default page will remain "unreaped". This will break if that assumption changes
|
||||
$.testHelper.pageSequence([
|
||||
function() {
|
||||
$.mobile.changePage( "#dialog" );
|
||||
},
|
||||
|
||||
$.each(degradeInputs, function( oldType, newType ) {
|
||||
if (newType === false) {
|
||||
newType = oldType;
|
||||
function() {
|
||||
$.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, "type attr on page is: " + newType);
|
||||
|
||||
$('#dialog-test-container').html('<input type="' + oldType + '" />').trigger("create");
|
||||
|
||||
same($('#dialog-test-container input').attr("type"), newType, "type attr on dialog is: " + newType);
|
||||
});
|
||||
|
||||
start();
|
||||
}
|
||||
|
||||
$('#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);
|
||||
Loading…
Reference in a new issue