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
path: root/tests
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2016-03-30 06:48:08 +0300
committermattab <matthieu.aubry@gmail.com>2016-03-30 06:53:59 +0300
commit81c48b897b4d465a90b0715a9f12daf0e2df7a3d (patch)
tree00fa65c6f303b1477b3fd012ac7d76b3d261b49e /tests
parent46de0cf98a7f63fd7b421363042da20e5af86064 (diff)
New unit test ensuring that JS SDK getCookieName depends on website ID refs https://github.com/piwik/piwik/issues/9932
Diffstat (limited to 'tests')
-rw-r--r--tests/javascript/index.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php
index fa07f38500..be9af836da 100644
--- a/tests/javascript/index.php
+++ b/tests/javascript/index.php
@@ -2537,6 +2537,24 @@ function PiwikTest() {
equal( tracker.hook.test._getCookie( cookieName ), expectedValue, 'getCookie(), setCookie()' );
});
+ test("Tracker getCookieName() contains website ID", function() {
+ expect(4);
+
+ var tracker = Piwik.getTracker();
+ tracker.setTrackerUrl("piwik.php");
+
+ tracker.setSiteId(1);
+ cookieName = tracker.hook.test._getCookieName('testing');
+ ok( cookieName.indexOf('testing.1.') != -1);
+ ok( cookieName.indexOf('testing.2.') == -1);
+
+ tracker.setSiteId(2);
+ cookieName = tracker.hook.test._getCookieName('testing-another');
+ ok( cookieName.indexOf('testing-another.2.') != -1);
+ ok( cookieName.indexOf('testing-another.1.') == -1);
+
+ });
+
test("Tracker setDownloadExtensions(), addDownloadExtensions(), setDownloadClasses(), setLinkClasses(), and getLinkType()", function() {
expect(72);