mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-26 09:04:43 +00:00
started core testing
This commit is contained in:
parent
a11a387e8b
commit
0a023fa46a
2 changed files with 69 additions and 0 deletions
33
tests/unit/core/core.js
Normal file
33
tests/unit/core/core.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* mobile core unit tests
|
||||
*/
|
||||
|
||||
(function( $ ) {
|
||||
var libName = "jquery.mobile.core.js",
|
||||
setGradeA = function(value) { $.support.mediaquery = value; };
|
||||
|
||||
module(libName);
|
||||
|
||||
$.testHelper.excludeFileProtocol(function(){
|
||||
|
||||
test("grade A browser support media queries", function(){
|
||||
setGradeA(false);
|
||||
$.testHelper.reloadLib(libName);
|
||||
ok(!$.mobile.gradeA());
|
||||
|
||||
setGradeA(true);
|
||||
$.testHelper.reloadLib(libName);
|
||||
ok($.mobile.gradeA());
|
||||
});
|
||||
|
||||
test("loading the core library triggers mobilinit on the document", function(){
|
||||
expect( 1 );
|
||||
|
||||
$(window.document).bind('mobileinit', function(event){
|
||||
ok(true);
|
||||
});
|
||||
|
||||
$.testHelper.reloadLib(libName);
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
36
tests/unit/core/index.html
Normal file
36
tests/unit/core/index.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>jQuery Mobile Core Test Suite</title>
|
||||
|
||||
<script type="text/javascript" src="../../../js/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../../tests/jquery.testHelper.js"></script>
|
||||
<script type="text/javascript" src="../../../js/jquery.ui.widget.js"></script>
|
||||
<script type="text/javascript" src="../../../js/jquery.mobile.widget.js"></script>
|
||||
<script type="text/javascript" src="../../../js/jquery.mobile.media.js"></script>
|
||||
<script type="text/javascript" src="../../../js/jquery.mobile.support.js"></script>
|
||||
<script type="text/javascript" src="../../../js/jquery.mobile.event.js"></script>
|
||||
<script type="text/javascript" src="../../../js/jquery.mobile.hashchange.js"></script>
|
||||
<script type="text/javascript" src="../../../js/jquery.mobile.page.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../../../js/jquery.mobile.core.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
|
||||
<script type="text/javascript" src="core.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="qunit-header">jQuery Mobile Core Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests">
|
||||
</ol>
|
||||
|
||||
<div id="main" style="position: absolute; top: -10000px; left: -10000px;">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue