first set of tests for path handling per Kin's wiki page

This commit is contained in:
John Bender 2011-04-27 22:43:41 -07:00
parent 31604bb75a
commit 84c1cfbcd8
4 changed files with 69 additions and 2 deletions

View 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>

View file

@ -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>

View 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);

View 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>