From 84c1cfbcd80d07c00b9f83c2a50fcdea4b396c0c Mon Sep 17 00:00:00 2001 From: John Bender Date: Wed, 27 Apr 2011 22:43:41 -0700 Subject: [PATCH] first set of tests for path handling per Kin's wiki page --- tests/unit/navigation/file.html | 11 +++++++ tests/unit/navigation/index.html | 13 ++++++-- tests/unit/navigation/navigation_paths.js | 36 ++++++++++++++++++++++ tests/unit/navigation/path-tests/file.html | 11 +++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 tests/unit/navigation/file.html create mode 100644 tests/unit/navigation/navigation_paths.js create mode 100644 tests/unit/navigation/path-tests/file.html diff --git a/tests/unit/navigation/file.html b/tests/unit/navigation/file.html new file mode 100644 index 00000000..110f01f6 --- /dev/null +++ b/tests/unit/navigation/file.html @@ -0,0 +1,11 @@ + + + + + + +
+
doc rel file ref no nest
+
+ + diff --git a/tests/unit/navigation/index.html b/tests/unit/navigation/index.html index 9fdba3f5..5e274e8f 100644 --- a/tests/unit/navigation/index.html +++ b/tests/unit/navigation/index.html @@ -16,8 +16,9 @@ - - + + + @@ -181,5 +182,13 @@ + +
+ go +
+ +
+ go +
diff --git a/tests/unit/navigation/navigation_paths.js b/tests/unit/navigation/navigation_paths.js new file mode 100644 index 00000000..cdb437bf --- /dev/null +++ b/tests/unit/navigation/navigation_paths.js @@ -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); \ No newline at end of file diff --git a/tests/unit/navigation/path-tests/file.html b/tests/unit/navigation/path-tests/file.html new file mode 100644 index 00000000..498cb199 --- /dev/null +++ b/tests/unit/navigation/path-tests/file.html @@ -0,0 +1,11 @@ + + + + + + +
+
doc rel file ref nested
+
+ +