mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-01 11:24:42 +00:00
added media core tests
This commit is contained in:
parent
330dc18dbb
commit
319e3054cd
2 changed files with 57 additions and 0 deletions
36
tests/unit/media/index.html
Normal file
36
tests/unit/media/index.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>jQuery Mobile Media Test Suite</title>
|
||||
|
||||
<script type="text/javascript" src="../../../js/jquery.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>
|
||||
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||
|
||||
<script type="text/javascript" src="media_core.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="qunit-header">jQuery Mobile Media 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 id="widget-wrapper">
|
||||
<div id="widget">
|
||||
<div>...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
21
tests/unit/media/media_core.js
Normal file
21
tests/unit/media/media_core.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* mobile media unit tests
|
||||
*/
|
||||
|
||||
(function( $ ) {
|
||||
test( "media check returns true when the position is absolute", function(){
|
||||
expect( 1 );
|
||||
$.fn.css = function(){ return "absolute"; };
|
||||
same($.mobile.media('screen'), true);
|
||||
});
|
||||
|
||||
test( "media check is cached", function(){
|
||||
expect( 2 );
|
||||
|
||||
$.fn.css = function(){ return "absolute"; };
|
||||
same($.mobile.media('screen'), true);
|
||||
|
||||
$.fn.css = function(){ return "not absolute"; };
|
||||
same($.mobile.media('screen'), true);
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue