Skip to content

Commit c3a8630

Browse files
author
scottjehl
committed
unit test for path.makeAbsolute
1 parent 70d4187 commit c3a8630

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/unit/navigation/navigation_core.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,17 @@
5252

5353

5454
test( "path.set method is working properly", function(){
55+
$.mobile.urlHistory.listeningEnabled = false;
5556
$.mobile.path.set("foo");
5657
same("foo", window.location.hash.replace(/^#/,""), "sets location.hash properly");
58+
location.hash = "";
59+
});
60+
61+
test( "path.makeAbsolute is working properly", function(){
62+
$.mobile.urlHistory.listeningEnabled = false;
63+
$.mobile.path.set("bar/");
64+
same( $.mobile.path.makeAbsolute("test.html"), "bar/test.html", "prefixes path with absolute base path from hash");
65+
location.hash = "";
5766
});
5867

5968

0 commit comments

Comments
 (0)