From 921ab705f5a2248d27e3f08b11ae8cdd501272c5 Mon Sep 17 00:00:00 2001 From: John Bender Date: Wed, 4 Jan 2012 13:13:09 -0800 Subject: [PATCH] fix async loading select test issue where keepnative isn't defined in time for the leading test --- tests/unit/select/defineKeepNative.js | 4 ++++ tests/unit/select/index.html | 3 ++- tests/unit/select/select_core.js | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 tests/unit/select/defineKeepNative.js diff --git a/tests/unit/select/defineKeepNative.js b/tests/unit/select/defineKeepNative.js new file mode 100644 index 00000000..ed60f684 --- /dev/null +++ b/tests/unit/select/defineKeepNative.js @@ -0,0 +1,4 @@ +$(document).bind("mobileinit", function() { + $.mobile.page.prototype.options.keepNative = "select.should-be-native"; +}); + diff --git a/tests/unit/select/index.html b/tests/unit/select/index.html index fbd4d172..0aa5f53e 100644 --- a/tests/unit/select/index.html +++ b/tests/unit/select/index.html @@ -14,7 +14,8 @@ $.testHelper.asyncLoad([ [ "jquery.mobile.forms.select", - "jquery.mobile.forms.select.custom" + "jquery.mobile.forms.select.custom", + "defineKeepNative.js" ], [ "jquery.mobile.init" ], [ diff --git a/tests/unit/select/select_core.js b/tests/unit/select/select_core.js index da60aeb5..a2d36e54 100644 --- a/tests/unit/select/select_core.js +++ b/tests/unit/select/select_core.js @@ -334,8 +334,6 @@ same(window.encodedValueIsDefined, true); }); - $.mobile.page.prototype.options.keepNative = "select.should-be-native"; - // not testing the positive case here since's it's obviously tested elsewhere test( "select elements in the keepNative set shouldn't be enhanced", function() { ok( !$("#keep-native").parent().is("div.ui-btn") );