diff --git a/tests/unit/degradeInputs/degradeInputs.js b/tests/unit/degradeInputs/degradeInputs.js
index 487a6934..fef36d6d 100644
--- a/tests/unit/degradeInputs/degradeInputs.js
+++ b/tests/unit/degradeInputs/degradeInputs.js
@@ -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('').trigger("create");
+
+ same($('#page-test-container input').attr("type"), newType, "type attr on page is: " + newType);
+
+ $('#dialog-test-container').html('').trigger("create");
+
+ same($('#dialog-test-container input').attr("type"), newType, "type attr on dialog is: " + newType);
+ });
+
+ start();
}
-
- $('#page-test-container').html('').trigger("create");
-
- same($('#page-test-container input').attr("type"), newType);
-
- $('#dialog-test-container').html('').trigger("create");
-
- same($('#dialog-test-container input').attr("type"), newType);
- });
+ ]);
});
})(jQuery);
\ No newline at end of file