mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
first set of tests for path handling per Kin's wiki page
This commit is contained in:
parent
31604bb75a
commit
84c1cfbcd8
4 changed files with 69 additions and 2 deletions
11
tests/unit/navigation/file.html
Normal file
11
tests/unit/navigation/file.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div data-nstest-role="page">
|
||||
<div class="test-value">doc rel file ref no nest</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -16,8 +16,9 @@
|
|||
<script src="../../../external/qunit.js"></script>
|
||||
|
||||
<script src="navigation_transitions.js"></script>
|
||||
<script src="navigation_helpers.js"></script>
|
||||
<script src="navigation_core.js"></script>
|
||||
<script src="navigation_helpers.js"></script>
|
||||
<script src="navigation_core.js"></script>
|
||||
<script src="navigation_paths.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
@ -181,5 +182,13 @@
|
|||
<div data-nstest-role="page" id="dialog-param-link">
|
||||
<a href="dialog-param-test/dialog-param.html">go</a>
|
||||
</div>
|
||||
|
||||
<div data-nstest-role="page" id="doc-rel-file-ref-no-nest">
|
||||
<a href="file.html">go</a>
|
||||
</div>
|
||||
|
||||
<div data-nstest-role="page" id="doc-rel-file-ref-nested">
|
||||
<a href="path-tests/file.html">go</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
36
tests/unit/navigation/navigation_paths.js
Normal file
36
tests/unit/navigation/navigation_paths.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* mobile navigation path unit tests
|
||||
*/
|
||||
(function($){
|
||||
module("jquery.mobile.navigation.js");
|
||||
|
||||
var testPageLoad = function(testPageSelector, expectedTextValue){
|
||||
expect( 1 );
|
||||
|
||||
$.testHelper.sequence([
|
||||
// open our test page
|
||||
function(){
|
||||
$.testHelper.openPage(testPageSelector);
|
||||
},
|
||||
|
||||
// navigate to the linked page
|
||||
function(){
|
||||
$(".ui-page-active a").click();
|
||||
},
|
||||
|
||||
// verify that the page has changed and the expected text value is present
|
||||
function(){
|
||||
same($(".ui-page-active .test-value").text(), expectedTextValue);
|
||||
start();
|
||||
}
|
||||
], 800);
|
||||
};
|
||||
|
||||
asyncTest( "document relative file reference no nesting", function(){
|
||||
testPageLoad("#doc-rel-file-ref-no-nest", "doc rel file ref no nest");
|
||||
});
|
||||
|
||||
asyncTest( "document relative file reference with nesting", function(){
|
||||
testPageLoad("#doc-rel-file-ref-nested", "doc rel file ref nested");
|
||||
});
|
||||
})(jQuery);
|
||||
11
tests/unit/navigation/path-tests/file.html
Normal file
11
tests/unit/navigation/path-tests/file.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<div data-nstest-role="page">
|
||||
<div class="test-value">doc rel file ref nested</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue