mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-13 17:13:10 +00:00
tests for enhance and exclusion through keepNative
This commit is contained in:
parent
b958e84e2c
commit
623433f75b
2 changed files with 50 additions and 0 deletions
14
tests/unit/button/button_core.js
Normal file
14
tests/unit/button/button_core.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* mobile button unit tests
|
||||
*/
|
||||
(function($){
|
||||
$.mobile.page.prototype.options.keepNative = "button.should-be-native";
|
||||
|
||||
test( "button elements in the keepNative set shouldn't be enhanced", function() {
|
||||
same( $("button.should-be-native").siblings("div.ui-slider").length, 0 );
|
||||
});
|
||||
|
||||
test( "button elements should be enhanced", function() {
|
||||
ok( $("#enhanced").hasClass( "ui-btn-hidden" ) );
|
||||
});
|
||||
})( jQuery );
|
||||
36
tests/unit/button/index.html
Normal file
36
tests/unit/button/index.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>jQuery Mobile Button Test Suite</title>
|
||||
|
||||
<script src="../../../js/jquery.js"></script>
|
||||
<script src="../jquery.setNameSpace.js"></script>
|
||||
<script src="../../../js/"></script>
|
||||
<script src="../../../tests/jquery.testHelper.js"></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../../../themes/default/"/>
|
||||
<link rel="stylesheet" href="../../../external/qunit.css"/>
|
||||
<script src="../../../external/qunit.js"></script>
|
||||
|
||||
<script src="button_core.js"></script>
|
||||
|
||||
<script src="../swarminject.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="qunit-header">jQuery Mobile Button Test Suite</h1>
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests">
|
||||
</ol>
|
||||
|
||||
<div data-nstest-role="page" data-nstest-theme="a">
|
||||
<div data-nstest-role="content" data-nstest-theme="p">
|
||||
<button class="should-be-native">foo</button>
|
||||
<button id="enhanced">bar</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue