Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

alter pageinit test to validate that child widgets are in fact enhanc…

…ed when the event is fired. covers the previous tests case
  • Loading branch information...
commit c61354447c1e2045cbac8e0753efad2ead7939af 1 parent 095d731
John Bender johnbender authored
1  tests/unit/widget/index.html
View
@@ -33,6 +33,7 @@ <h2 id="qunit-userAgent"></h2>
</div>
<div id="foo" data-role="page">
+ <input type="range" id="foo-slider" name="foo-slider" value="" />
</div>
</body>
12 tests/unit/widget/widget_init.js
View
@@ -2,15 +2,19 @@
* mobile widget unit tests
*/
(function($){
- var initFired = false;
+ var widgetInitialized = false;
module( 'jquery.mobile.widget.js' );
$( "#foo" ).live( 'pageinit', function(){
- initFired = true;
+ // ordering sensitive here, the value has to be set after the call
+ // so that if the widget factory says that its not yet initialized,
+ // which is an exception, the value won't be set
+ $( "#foo-slider" ).slider( 'refresh' );
+ widgetInitialized = true;
});
- test( "widget init event is fired after markup enhancement has taken place", function() {
- ok( initFired );
+ test( "page is enhanced before init is fired", function() {
+ ok( widgetInitialized );
});
})( jQuery );
Please sign in to comment.
Something went wrong with that request. Please try again.