Permalink
Browse files

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

  • Loading branch information...
johnbender committed Apr 28, 2011
1 parent 31604bb commit 84c1cfbcd80d07c00b9f83c2a50fcdea4b396c0c
@@ -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 @@ <h1>Dialog</h1>
<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>
@@ -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);
@@ -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>

0 comments on commit 84c1cfb

Please sign in to comment.