11---
22/**
3- * @file Environment client fixture for E2E tests.
4- * @description This page intentionally skips BaseLayout to keep hydration minimal for diagnostics.
5- * @note Exception: page fixtures normally wrap content in BaseLayout, but this file avoids it on purpose.
3+ * @file Environment client fixture for E2E tests. This page intentionally
4+ * skips BaseLayout to keep hydration minimal for diagnostics.
65 */
76const pageTitle = ' Environment Client Values'
87---
@@ -14,36 +13,42 @@ const pageTitle = 'Environment Client Values'
1413 <meta name =" robots" content =" noindex, nofollow" />
1514 <style >
1615 html {
17- font-family: system-ui, sans-serif;
1816 background: #0b1118;
1917 color: #f4f7fb;
18+ font-family: system-ui, sans-serif;
2019 }
20+
2121 body {
2222 margin: 0;
2323 padding: 2rem;
2424 }
25+
2526 main {
26- max-width: 42rem;
2727 margin: 0 auto;
28+ max-width: 42rem;
2829 }
30+
2931 .env-grid {
3032 display: grid;
3133 gap: 1rem;
3234 }
35+
3336 .env-card {
34- border: 1px solid rgba(244, 247, 251, 0.2);
37+ background: rgb(255 255 255 / 4%);
38+ border: 1px solid rgb(244 247 251 / 20%);
3539 border-radius: 0.5rem;
3640 padding: 1rem;
37- background: rgba(255, 255, 255, 0.04);
3841 }
42+
3943 .env-label {
40- text-transform: uppercase ;
44+ display: block ;
4145 font-size: 0.75rem;
4246 letter-spacing: 0.08em;
43- opacity: 0.7;
4447 margin-bottom: 0.35rem;
45- display: block;
48+ opacity: 0.7;
49+ text-transform: uppercase;
4650 }
51+
4752 .env-value {
4853 font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
4954 font-size: 1rem;
@@ -69,55 +74,8 @@ const pageTitle = 'Environment Client Values'
6974 </article >
7075 </section >
7176 </main >
72- <script type =" module" is:inline >
73- import {
74- getPackageRelease,
75- getPrivacyPolicyVersion,
76- } from '@components/scripts/utils/environmentClient'
77-
78- /**
79- * @typedef {'package-release' | 'privacy-policy-version'} EnvValueKey
80- * @typedef {'ready' | 'error'} EnvElementState
81- * @typedef {{ packageRelease: string; privacyPolicyVersion: string }} EnvClientValues
82- */
83-
84- /**
85- * @param {EnvValueKey} key
86- * @param {string} value
87- * @param {EnvElementState} [state='ready']
88- */
89- const setValue = (key, value, state = 'ready') => {
90- const element = /** @type {HTMLOutputElement | null} */ (
91- document.querySelector(`[data-env-value="${key}"]`)
92- )
93- if (!element) return
94- element.textContent = value
95- element.dataset['state'] = state
96- }
97-
98- /** @type {EnvClientValues} */
99- const values = {
100- packageRelease: '',
101- privacyPolicyVersion: '',
102- }
103-
104- try {
105- values.packageRelease = getPackageRelease()
106- setValue('package-release', values.packageRelease)
107- } catch (error) {
108- values.packageRelease = String(error)
109- setValue('package-release', values.packageRelease, 'error')
110- }
111-
112- try {
113- values.privacyPolicyVersion = getPrivacyPolicyVersion()
114- setValue('privacy-policy-version', values.privacyPolicyVersion)
115- } catch (error) {
116- values.privacyPolicyVersion = String(error)
117- setValue('privacy-policy-version', values.privacyPolicyVersion, 'error')
118- }
119-
120- window.environmentClientValues = values
77+ <script >
78+ import '@pages/testing/_environment-client-values'
12179 </script >
12280 </body >
12381</html >
0 commit comments