Skip to content

Commit 3484c40

Browse files
author
scottjehl
committed
added unit test for path.hasProtocol
1 parent 20c86f6 commit 3484c40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/unit/navigation/navigation_core.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181

8282
});
8383

84+
test( "path.hasProtocol is working properly", function(){
85+
same( $.mobile.path.hasProtocol( "tel:5559999" ), true, "value in tel protocol format has protocol" );
86+
same( $.mobile.path.hasProtocol( location.href ), true, "location href has protocol" );
87+
same( $.mobile.path.hasProtocol( "foo/bar/baz.html" ), false, "simple directory path has no protocol" );
88+
same( $.mobile.path.hasProtocol( "file://foo/bar/baz.html" ), true, "simple directory path with file:// has protocol" );
89+
});
8490

8591
test( "path.isExternal is working properly", function(){
8692
same( $.mobile.path.isExternal( location.href ), false, "same domain is not external" );

0 commit comments

Comments
 (0)