Skip to content

Commit 7386704

Browse files
committed
Revert "Try to fix the E2E test with AI in Opus 4.5"
This reverts commit a2f564d.
1 parent 1b75d2f commit 7386704

File tree

3 files changed

+42
-10
lines changed

3 files changed

+42
-10
lines changed

resources/css/settings.css

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
@import url(https://fonts.bunny.net/css?family=space-grotesk:500,600);
22

3-
.sa-settings {
4-
@tailwind base;
5-
@tailwind components;
6-
}
7-
3+
@tailwind base;
4+
@tailwind components;
85
@tailwind utilities;

src/UI/PageLayoutComponent.php

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public function __invoke(): void
3131
padding-left: 0;
3232
}
3333
</style>
34-
<link rel="preconnect" href="https://fonts.bunny.net">
35-
<link rel="stylesheet" href="<?php echo PLUGIN_URL ?>build/css/settings.css">
36-
<div class="sa-settings">
34+
<template shadowrootmode="open">
35+
<link rel="preconnect" href="https://fonts.bunny.net">
36+
<link rel="stylesheet" href="<?php echo PLUGIN_URL ?>build/css/settings.css">
3737
<form method="post" action="options.php">
3838
<!-- Hidden fields -->
3939
<?php settings_fields($this->page->getOptionGroup($currentTab)); ?>
@@ -106,8 +106,22 @@ function sa_textarea_add_value(textarea, value) {
106106
textarea.value += `\n${value}`;
107107
}
108108
}
109-
</script>
110-
</div>
109+
</script>
110+
</template>
111+
<script>
112+
// Polyfill in case the browser has no support for shadowRootMode
113+
// 1. https://developer.chrome.com/docs/css-ui/declarative-shadow-dom#polyfill
114+
// 2. https://caniuse.com/mdn-html_elements_template_shadowrootmode
115+
(function attachShadowRoots(root) {
116+
root.querySelectorAll("template[shadowrootmode]").forEach(template => {
117+
const mode = template.getAttribute("shadowrootmode");
118+
const shadowRoot = template.parentNode.attachShadow({ mode });
119+
shadowRoot.appendChild(template.content);
120+
template.remove();
121+
attachShadowRoots(shadowRoot);
122+
});
123+
})(document);
124+
</script>
111125
<?php
112126
}
113127

tests/Browser/PluginSettingsTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,25 @@ public function test_adds_script_with_ignored_pages(): void
3535
->visit('/')
3636
->assertContains('data-ignore-pages="/vouchers"');
3737
}
38+
//it('adds inactive script for selected user roles', function () {
39+
// $admin = asAdmin()->navigate('http://localhost:8100/wp-admin/options-general.php?page=simpleanalytics&tab=ignore-rules')
40+
// ->check('simpleanalytics_exclude_user_roles-editor')
41+
// ->check('simpleanalytics_exclude_user_roles-author')
42+
// ->click('Save Changes')
43+
// ->assertChecked('simpleanalytics_exclude_user_roles-editor')
44+
// ->assertChecked('simpleanalytics_exclude_user_roles-author');
45+
//
46+
// $admin->navigate('http://localhost:8100')
47+
// ->assertPresent(DEFAULT_SCRIPT_SELECTOR);
48+
//
49+
// asAuthor()->navigate('http://localhost:8100')
50+
// ->assertPresent(INACTIVE_ADMIN_SCRIPT_SELECTOR)
51+
// ->assertSourceHas(INACTIVE_ADMIN_COMMENT);
52+
//
53+
// asEditor()->navigate('http://localhost:8100')
54+
// ->assertPresent(INACTIVE_ADMIN_SCRIPT_SELECTOR)
55+
// ->assertSourceHas(INACTIVE_ADMIN_COMMENT);
56+
//});
57+
58+
// public function
3859
}

0 commit comments

Comments
 (0)