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:
authorMatthieu Aubry <matt@piwik.org>2015-03-11 03:06:21 +0300
committerMatthieu Aubry <matt@piwik.org>2015-03-11 03:06:21 +0300
commit3db2044b94b411ac7c13e417582d06cd9c760acf (patch)
tree26279ec41a314d11301a81dfdaaa87e886fde3c3 /tests
parent3bafa52ce555aec0d3d8d5d6315f0a23198d7a07 (diff)
parent12363f9ca7e17ba3b0b24d8fd214e1685939856d (diff)
Merge pull request #7402 from piwik/7368
Do not set user id when it's set to empty string
Diffstat (limited to 'tests')
-rw-r--r--tests/javascript/index.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php
index 20fade48ea..072dd42538 100644
--- a/tests/javascript/index.php
+++ b/tests/javascript/index.php
@@ -2370,7 +2370,7 @@ function PiwikTest() {
}
test("User ID and Visitor UUID", function() {
- expect(16);
+ expect(19);
deleteCookies();
var userIdString = 'userid@mydomain.org';
@@ -2396,6 +2396,13 @@ function PiwikTest() {
var visitorId = tracker.getVisitorId();
equal(visitorId, tracker.getVisitorId(), "Visitor ID is the same when called multiple times");
+ // Check that setting an empty user id will not change the visitor ID
+ var userId = '';
+ equal(userId, tracker.getUserId(), "by default user ID is set to empty string");
+ tracker.setUserId(userId);
+ equal(userId, tracker.getUserId(), "after setting to empty string, user id is still empty");
+ equal(visitorId, tracker.getVisitorId(), "visitor id was not changed after setting empty user id");
+
// Building another 'tracker2' object so we can compare behavior to 'tracker'
var tracker2 = Piwik.getTracker();
equal(tracker.getVisitorId(), tracker2.getVisitorId(), "Visitor ID " + tracker.getVisitorId() + " is the same as Visitor ID 2 " + tracker2.getVisitorId());