diff options
| author | Sem <sembrestels@riseup.net> | 2011-11-03 03:44:33 +0100 | 
|---|---|---|
| committer | Sem <sembrestels@riseup.net> | 2011-11-03 03:44:33 +0100 | 
| commit | c466a2d2306011b18d7d5f9a1bca0eae5560f980 (patch) | |
| tree | 4f9e2fc4ba354af99446e796c31487892722e277 /js/tests | |
| parent | 9fa1a7b0b1dd363d16784707bcbb9c3e7c85966f (diff) | |
| download | elgg-c466a2d2306011b18d7d5f9a1bca0eae5560f980.tar.gz elgg-c466a2d2306011b18d7d5f9a1bca0eae5560f980.tar.bz2  | |
Fixes #3976. elgg.normalize_url() js function has the fix in #3747.
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/ElggLibTest.js | 32 | 
1 files changed, 27 insertions, 5 deletions
diff --git a/js/tests/ElggLibTest.js b/js/tests/ElggLibTest.js index dd0267c5c..688a1016c 100644 --- a/js/tests/ElggLibTest.js +++ b/js/tests/ElggLibTest.js @@ -73,12 +73,34 @@ ElggLibTest.prototype.testNormalizeUrl = function() {  	[  	    ['', elgg.config.wwwroot], -	    ['test', elgg.config.wwwroot + 'test'], -	    ['http://google.com', 'http://google.com'], +	    ['http://example.com', 'http://example.com'], +	    ['https://example.com', 'https://example.com'], +	    ['http://example-time.com', 'http://example-time.com'],  	    ['//example.com', '//example.com'], -	    ['/page', elgg.config.wwwroot + 'page'], -	    ['mod/plugin/index.php', elgg.config.wwwroot + 'mod/plugin/index.php'], + +	    ['ftp://example.com/file', 'ftp://example.com/file', +	    ['mailto:brett@elgg.org', 'mailto:brett@elgg.org', +	    ['javascript:alert("test")', 'javascript:alert("test")', +	    ['app://endpoint', 'app://endpoint', + +	    ['example.com', 'http://example.com', +	    ['example.com/subpage', 'http://example.com/subpage', + +	    ['page/handler', elgg.config.wwwroot + 'page/handler', +	    ['page/handler?p=v&p2=v2', elgg.config.wwwroot + 'page/handler?p=v&p2=v2', +	    ['mod/plugin/file.php', elgg.config.wwwroot + 'mod/plugin/file.php', +	    ['mod/plugin/file.php?p=v&p2=v2', elgg.config.wwwroot + 'mod/plugin/file.php?p=v&p2=v2', +	    ['rootfile.php', elgg.config.wwwroot + 'rootfile.php', +	    ['rootfile.php?p=v&p2=v2', elgg.config.wwwroot + 'rootfile.php?p=v&p2=v2', + +	    ['/page/handler', elgg.config.wwwroot + 'page/handler', +	    ['/page/handler?p=v&p2=v2', elgg.config.wwwroot + 'page/handler?p=v&p2=v2', +	    ['/mod/plugin/file.php', elgg.config.wwwroot + 'mod/plugin/file.php', +	    ['/mod/plugin/file.php?p=v&p2=v2', elgg.config.wwwroot + 'mod/plugin/file.php?p=v&p2=v2', +	    ['/rootfile.php', elgg.config.wwwroot + 'rootfile.php', +	    ['/rootfile.php?p=v&p2=v2', elgg.config.wwwroot + 'rootfile.php?p=v&p2=v2', +  	].forEach(function(args) {  		assertEquals(args[1], elgg.normalize_url(args[0]));  	}); -};
\ No newline at end of file +};  | 
