From fe994b7c0c40b67b8e84365e821905459266d307 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Wed, 26 Jan 2011 00:02:34 -0500 Subject: [PATCH] added unit test for path.getFilePath --- tests/unit/navigation/navigation_core.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index a8f62348..bc30fd57 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -38,11 +38,17 @@ same(called, 2, "change page should be called twice"); }); + + test( "path.get method is working properly", function(){ same($.mobile.path.get(), window.location.hash, "get method returns location.hash"); same($.mobile.path.get( "#foo/bar/baz.html" ), "foo/bar/", "get method with hash arg returns path with no filename or hash prefix"); same($.mobile.path.get( "#foo/bar/baz.html/" ), "foo/bar/baz.html/", "last segment of hash is retained if followed by a trailing slash"); }); + + test( "path.getFilePath method is working properly", function(){ + same($.mobile.path.getFilePath("foo.html" + "&" $.mobile.subPageUrlKey ), "foo.html", "returns path without sub page key"); + }); test( "path.isExternal method is working properly", function(){ same($.mobile.path.isExternal("mailto:"), true, "mailto protocol");