mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-16 18:41:06 +00:00
init test for jqm using page widget
This commit is contained in:
parent
ae2e7f0dc4
commit
f932c9b13d
2 changed files with 18 additions and 2 deletions
|
|
@ -5,11 +5,12 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>jQuery Mobile Widget Test Suite</title>
|
||||
|
||||
<script src="../../../external/qunit.js"></script>
|
||||
<script src="../../../js/jquery.js"></script>
|
||||
<script src="widget_init.js"></script>
|
||||
<script src="../../../js/"></script>
|
||||
|
||||
<link rel="stylesheet" href="../../../external/qunit.css"/>
|
||||
<script src="../../../external/qunit.js"></script>
|
||||
|
||||
<script src="widget_core.js"></script>
|
||||
</head>
|
||||
|
|
@ -34,6 +35,5 @@
|
|||
<div id="foo" data-role="page">
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
16
tests/unit/widget/widget_init.js
Normal file
16
tests/unit/widget/widget_init.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* mobile widget unit tests
|
||||
*/
|
||||
(function($){
|
||||
var initFired = false;
|
||||
|
||||
module( 'jquery.mobile.widget.js' );
|
||||
|
||||
$( "#foo" ).live( 'pageinit', function(){
|
||||
initFired = true;
|
||||
});
|
||||
|
||||
test( "widget init event is fired after markup enhancement has taken place", function() {
|
||||
ok( initFired );
|
||||
});
|
||||
})( jQuery );
|
||||
Loading…
Reference in a new issue