Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Aubry <mattab@users.noreply.github.com>2016-07-15 05:12:54 +0300
committerGitHub <noreply@github.com>2016-07-15 05:12:54 +0300
commited024096d4b5bd45e8618e6804da09486aca31f1 (patch)
tree1fabca419b5b87cfc12b485d3dd575eced317427 /tests/javascript
parent319f519555f523291fa678fbe05c0d1a2b22dec9 (diff)
piwik.js: Prepend a slash to all paths such as when users don't specify leading slash for URL path (#10302)
Diffstat (limited to 'tests/javascript')
-rw-r--r--tests/javascript/index.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php
index 76e0f6c223..3f80e74f18 100644
--- a/tests/javascript/index.php
+++ b/tests/javascript/index.php
@@ -2330,7 +2330,7 @@ function PiwikTest() {
});
test("Tracker setDomains(), isSiteHostName(), isSiteHostPath(), and getLinkIfShouldBeProcessed()", function() {
- expect(157);
+ expect(165);
var tracker = Piwik.getTracker();
var initialDomains = tracker.getDomains();
@@ -2433,16 +2433,20 @@ function PiwikTest() {
// with path
tracker.setDomains( '.piwik.org/path' );
+ ok( isSiteHostPath('piwik.org', 'path'), 'isSiteHostPath("piwik.org", "path")' );
ok( isSiteHostPath('piwik.org', '/path'), 'isSiteHostPath("piwik.org", "/path")' );
ok( isSiteHostPath('piwik.org', '/path/'), 'isSiteHostPath("piwik.org", "/path/")' );
ok( !isSiteHostPath('piwik.org', '/path.htm'), 'isSiteHostPath("piwik.org", "/path.htm")' );
ok( isSiteHostPath('piwik.org', '/path/test'), 'isSiteHostPath("piwik.org", "/path/test)' );
ok( isSiteHostPath('dev.piwik.org', '/path'), 'isSiteHostPath("dev.piwik.org", "/path")' );
+ ok( !isSiteHostPath('piwik.com', ''), '!isSiteHostPath("piwik.com", "")');
+ ok( !isSiteHostPath('piwik.org', '/'), 'isSiteHostPath("piwik.org", "/")' );
ok( !isSiteHostPath('piwik.org', '/pat'), '!isSiteHostPath("piwik.org", "/pat")');
ok( !isSiteHostPath('piwik.org', '.com'), '!isSiteHostPath("piwik.org", ".com")');
ok( !isSiteHostPath('piwik.com', '/path'), '!isSiteHostPath("piwik.com", "/path")');
ok( !isSiteHostPath('piwik.com', '/path/test'), '!isSiteHostPath("piwik.com", "/path/test")');
- ok( !isSiteHostPath('piwik.com', ''), '!isSiteHostPath("piwik.com", "/path/test")');
+ ok( !isSiteHostPath('piwik.com', 'path/test'), '!isSiteHostPath("piwik.com", "/path/test")');
+ ok( !isSiteHostPath('piwik.com', 'path/test/'), '!isSiteHostPath("piwik.com", "/path/test")');
// no path
var domains = ['.piwik.org', 'piwik.org', '*.piwik.org', '.piwik.org/'];
@@ -2468,8 +2472,11 @@ function PiwikTest() {
// multiple paths / domains
tracker.setDomains( ['piwik.org/path', 'piwik.org/foo', 'piwik.org/bar/baz', '.piwik.pro/test'] );
+ ok( isSiteHostPath('piwik.pro', 'test/bar'), 'isSiteHostPath("piwik.pro", "test/bar")' );
ok( isSiteHostPath('piwik.pro', '/test/bar'), 'isSiteHostPath("piwik.pro", "/test/bar")' );
ok( !isSiteHostPath('piwik.org', '/foobar/'), 'isSiteHostPath("piwik.org", "/foobar/")' );
+ ok( !isSiteHostPath('piwik.org', 'foobar/'), 'isSiteHostPath("piwik.org", "foobar/")' );
+ ok( !isSiteHostPath('piwik.org', 'foobar'), 'isSiteHostPath("piwik.org", "foobar")' );
ok( isSiteHostPath('piwik.org', '/foo/bar'), 'isSiteHostPath("piwik.org", "/foo/bar")' );
ok( isSiteHostPath('piwik.org', '/bar/baz/foo'), 'isSiteHostPath("piwik.org", "/bar/baz/foo/")' );
ok( !isSiteHostPath('piwik.org', '/bar/ba'), 'isSiteHostPath("piwik.org", "/bar/ba")' );
@@ -2478,6 +2485,7 @@ function PiwikTest() {
ok( isSiteHostPath('dev.piwik.pro', '/test'), 'isSiteHostPath("dev.piwik.pro", "/test")' );
ok( !isSiteHostPath('dev.piwik.pro', 'something/test.htm'), 'isSiteHostPath("dev.piwik.pro", "something/test")' );
ok( !isSiteHostPath('dev.piwik.pro', '/'), 'isSiteHostPath("dev.piwik.pro", "/")' );
+ ok( !isSiteHostPath('dev.piwik.pro', ''), 'isSiteHostPath("dev.piwik.pro", "")' );
ok( !isSiteHostPath('piwik.org', '/'), 'isSiteHostPath("piwik.org", "/")' );
ok( !isSiteHostPath('piwik.pro', '/'), 'isSiteHostPath("piwik.pro", "/")' );
ok( !isSiteHostPath('piwik.org', '/index.htm'), 'isSiteHostPath("piwik.org", "/index.htm")' );