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:
authorBen <ben.burgess@innocraft.com>2022-11-05 04:52:44 +0300
committerBen <ben.burgess@innocraft.com>2022-11-05 04:52:44 +0300
commit1aea78cc37913b9c8b9247cb03b4e247e023ef95 (patch)
tree45c8d1895d8cdf1a9a187d2f40e7b5207beb348c
parentcbfaa8aad253092129983e0e235d12d762e0ce3a (diff)
Add new/update UI tests screenshots, fix unit test
-rw-r--r--core/SiteContentDetector.php11
-rw-r--r--plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_ConsentManager_consent_default.png3
-rw-r--r--plugins/Tour/API.php1
-rw-r--r--plugins/Tour/tests/UI/expected-screenshots/Tour_ConsentManager_widget_initial.png3
-rw-r--r--tests/UI/expected-screenshots/EmptySite_ConsentManager_emptySiteDashboard.png3
-rw-r--r--tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png4
6 files changed, 20 insertions, 5 deletions
diff --git a/core/SiteContentDetector.php b/core/SiteContentDetector.php
index 3fd2979d0f..46d745de58 100644
--- a/core/SiteContentDetector.php
+++ b/core/SiteContentDetector.php
@@ -77,9 +77,10 @@ class SiteContentDetector
return;
}
- // If the site data was already retrieved and stored in this object and it is for the same site id, then use it
- // again rather then making another request
- if ($this->siteData != null && $idSite == $this->siteId) {
+ // If the site data was already retrieved and stored in this object and it is for the same site id and we're
+ // not being passed a specific sitedata parameter, then use the stored sitedata again rather then making another
+ // request
+ if ($siteData === null && $this->siteData != null && $idSite == $this->siteId) {
$siteData = $this->siteData;
}
@@ -158,6 +159,10 @@ class SiteContentDetector
}
}
+ if (!isset($defs[$this->consentManagerId]['connectedStrings'])) {
+ return;
+ }
+
// If a consent manager was detected then perform an additional check to see if it has been connected to Matomo
foreach ($defs[$this->consentManagerId]['connectedStrings'] as $cStr) {
if (strpos($this->siteData, $cStr) !== false) {
diff --git a/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_ConsentManager_consent_default.png b/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_ConsentManager_consent_default.png
new file mode 100644
index 0000000000..fa9110b615
--- /dev/null
+++ b/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_ConsentManager_consent_default.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a8f80686de17ad288e2167a6573aa9225ab613b8fbb4c49c5376181c3e6e7706
+size 97194
diff --git a/plugins/Tour/API.php b/plugins/Tour/API.php
index 9dbfb6138b..2ab9c2ad56 100644
--- a/plugins/Tour/API.php
+++ b/plugins/Tour/API.php
@@ -71,6 +71,7 @@ class API extends \Piwik\Plugin\API
* Detect consent manager details for a site
*
* @return null|array[]
+ * @internal
*/
public function detectConsentManager($idSite, $timeOut = 60)
{
diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_ConsentManager_widget_initial.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_ConsentManager_widget_initial.png
new file mode 100644
index 0000000000..4390e829f3
--- /dev/null
+++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_ConsentManager_widget_initial.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e8ba8ff37ce30d38b0238d15ad91d516ec991241e8531b1b2d50c280013865e7
+size 41466
diff --git a/tests/UI/expected-screenshots/EmptySite_ConsentManager_emptySiteDashboard.png b/tests/UI/expected-screenshots/EmptySite_ConsentManager_emptySiteDashboard.png
new file mode 100644
index 0000000000..f08264af08
--- /dev/null
+++ b/tests/UI/expected-screenshots/EmptySite_ConsentManager_emptySiteDashboard.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:78987ae86702d6e40c090a3def12bb746ff230403dd57953814595b79fcac806
+size 165108
diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png
index fcb5c7a58d..07bcdbfb5a 100644
--- a/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png
+++ b/tests/UI/expected-screenshots/UIIntegrationTest_dashboard3.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:1ec360a961fc5c47f47e8137667420ed89c76e6fe69ffcde02302e8e8e5d97a4
-size 704446
+oid sha256:02ca84e8f6f42eb0b686def9934310cf11bdfabb5a8dbc107514f4177adb9a25
+size 704651