Skip to content

Commit 5eae457

Browse files
committed
update some screenshots and fix some tests
1 parent ce988f3 commit 5eae457

12 files changed

Lines changed: 33 additions & 31 deletions
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

tests/e2e/mwp-admin.marketplace.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('MWP Admin > Marketplace', () => {
6363

6464
it('should show the marketplace setup wizard when the marketplace plugins is not installed', async () => {
6565
await browser.refresh();
66-
await MwpMarketplacePage.openInstallPluginsTab();
66+
await MwpMarketplacePage.openMarketplacePluginsTab();
6767

6868
await MwpMarketplacePage.prepareWpAdminForScreenshot();
6969
await expect(
@@ -133,7 +133,7 @@ describe('MWP Admin > Marketplace', () => {
133133

134134
it('should load the install plugins tab correctly', async () => {
135135
await browser.refresh();
136-
await MwpMarketplacePage.openInstallPluginsTab();
136+
await MwpMarketplacePage.openMarketplacePluginsTab();
137137

138138
await MwpMarketplacePage.prepareWpAdminForScreenshot();
139139
await expect(
@@ -163,7 +163,7 @@ describe('MWP Admin > Marketplace', () => {
163163
});
164164

165165
it('should install and activate a premium plugin successfully', async () => {
166-
await MwpMarketplacePage.openInstallPluginsTab();
166+
await MwpMarketplacePage.openMarketplacePluginsTab();
167167
await MwpMarketplacePage.installPlugin('SEOWebVitals');
168168
await MwpMarketplacePage.activateInstalledPlugin();
169169

@@ -172,7 +172,7 @@ describe('MWP Admin > Marketplace', () => {
172172

173173
it('should bulk install and activate plugins correctly', async () => {
174174
await MwpMarketplacePage.open();
175-
await MwpMarketplacePage.openInstallPluginsTab();
175+
await MwpMarketplacePage.openMarketplacePluginsTab();
176176
const installedPlugins = await MwpMarketplacePage.bulkInstallMatomoPlugins();
177177
await MwpMarketplacePage.bulkActivateMatomoPlugins(installedPlugins);
178178
});

tests/e2e/pageobjects/mwp-admin/marketplace.page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class MwpMarketplacePage extends MwpPage {
7575
return await super.open('/wp-admin/admin.php?page=matomo-marketplace');
7676
}
7777

78-
async openInstallPluginsTab() {
79-
await $('a.nav-tab=Install Plugins').click();
78+
async openMarketplacePluginsTab() {
79+
await $('a.nav-tab=Marketplace').click();
8080

8181
await $('.matomo-plugin-card,.matomo-marketplace-wizard').waitForExist({ timeout: 120000 });
8282

tests/phpunit/framework/test-case.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,14 @@ private function delete_extraneous_blogs() {
117117
*/
118118
protected function get_type_attribute() {
119119
$type = '';
120-
if ( function_exists( 'wp_get_inline_script_tag' ) && ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) {
121-
$type = 'type="text/javascript"';
120+
if (
121+
function_exists( 'wp_get_inline_script_tag' )
122+
&& ! is_admin()
123+
&& ! current_theme_supports( 'html5', 'script' )
124+
&& getenv( 'WORDPRESS_VERSION' ) !== 'trunk'
125+
&& version_compare( getenv( 'WORDPRESS_VERSION' ), '6.4', '<' )
126+
) {
127+
$type = ' type="text/javascript"';
122128
}
123129
return $type;
124130
}
@@ -302,7 +308,6 @@ protected function is_wordpress_not_using_cdata_tags() {
302308
return getenv( 'WORDPRESS_VERSION' )
303309
&& (
304310
getenv( 'WORDPRESS_VERSION' ) !== 'latest'
305-
&& getenv( 'WORDPRESS_VERSION' ) !== 'trunk'
306311
&& version_compare( getenv( 'WORDPRESS_VERSION' ), '6.4', '<' )
307312
);
308313
}

tests/phpunit/wpmatomo/admin/test-adminsettings.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
use WpMatomo\Admin\AdminSettings;
77
use WpMatomo\Settings;
88

9-
/**
10-
* @group only
11-
*/
129
class AdminSettingsTest extends MatomoAnalytics_TestCase {
1310

1411
/**

tests/phpunit/wpmatomo/ecommerce/test-base.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function test_wrap_script_on_set_ecommerce_view() {
9393
}
9494

9595
$this->assertSame(
96-
'<script ' . $this->get_type_attribute() . ">\n$cdata_start" .
96+
'<script' . $this->get_type_attribute() . ">\n$cdata_start" .
9797
'window._paq = window._paq || []; window._paq.push(["setEcommerceView","sku","product-title",[],50]);' . PHP_EOL .
9898
"$cdata_end</script>" . PHP_EOL,
9999
$this->base->wrap_script( $this->base->make_matomo_js_tracker_call( $params ) )
@@ -125,7 +125,7 @@ public function test_wrap_script_on_set_ecommerce_view_if_cookies_disabled() {
125125
}
126126

127127
$this->assertSame(
128-
'<script ' . $this->get_type_attribute() . ">\n$cdata_start" .
128+
'<script' . $this->get_type_attribute() . ">\n$cdata_start" .
129129
'window._paq = window._paq || []; if (!window._paq.find || !window._paq.find(function (m) { return m[0] === "disableCookies"; })) {
130130
window._paq.push(["disableCookies"]);
131131
} window._paq.push(["setEcommerceView","sku","product-title",[],50]);' . PHP_EOL .
@@ -156,7 +156,7 @@ public function test_wrap_script_outputs_code_when_not_tracking_in_background()
156156
$script_type = $this->get_type_attribute();
157157

158158
$expected = <<<EOF
159-
<script $script_type>$cdata_start
159+
<script$script_type>$cdata_start
160160
window._paq = window._paq || []; window._paq.push(["trackEcommerceCartUpdate",400]);window._paq = window._paq || []; window._paq.push(["trackEcommerceOrder","orderid",300,200,40,60,0]);
161161
$cdata_end</script>
162162
@@ -404,7 +404,7 @@ public function test_maybe_do_delayed_tracking_uses_detected_visitor_information
404404
$script_type = $this->get_type_attribute();
405405

406406
$expected_tracking_code = <<<EOF
407-
<script $script_type>$cdata_start
407+
<script$script_type>$cdata_start
408408
window._paq = window._paq || []; window._paq.push(["trackEcommerceCartUpdate",100]);window._paq = window._paq || []; window._paq.push(["trackEcommerceOrder","orderid",300,200,40,60,0]);
409409
$cdata_end</script>
410410

0 commit comments

Comments
 (0)