|
1 | 1 | --- |
| 2 | +import BaseLayout from '@layouts/BaseLayout.astro' |
2 | 3 |
|
| 4 | +const pageTitle = 'Environment Client Diagnostics' |
| 5 | +const pageDescription = 'Client-side environment helper snapshot for automated testing only.' |
| 6 | +const pagePath = '/testing/environment-client' |
3 | 7 | --- |
4 | | -<!DOCTYPE html> |
5 | | -<html lang="en"> |
6 | | - <head> |
7 | | - <meta charset="utf-8"> |
8 | | - <title>Environment Client Diagnostics</title> |
9 | | - <meta name="robots" content="noindex, nofollow"> |
10 | | - </head> |
11 | | - <body> |
12 | | - <main> |
13 | | - <h1>Environment Client Diagnostics</h1> |
14 | | - <p data-testid="environment-client-notice"> |
15 | | - This page exposes environment utilities for automated testing only. |
16 | | - </p> |
17 | | - <pre id="environment-client-json">Collecting client environment data…</pre> |
18 | | - </main> |
19 | | - <script> |
20 | | - import { |
21 | | - getPackageRelease, |
22 | | - getPrivacyPolicyVersion, |
23 | | - isDev, |
24 | | - isE2eTest, |
25 | | - isProd, |
26 | | - isTest, |
27 | | - isUnitTest, |
28 | | - } from '@components/scripts/utils/environmentClient' |
29 | 8 |
|
30 | | - const snapshot = { |
31 | | - isUnitTest: isUnitTest(), |
32 | | - isTest: isTest(), |
33 | | - isE2eTest: isE2eTest(), |
34 | | - isDev: isDev(), |
35 | | - isProd: isProd(), |
36 | | - packageRelease: getPackageRelease(), |
37 | | - privacyPolicyVersion: getPrivacyPolicyVersion(), |
38 | | - } |
| 9 | +<BaseLayout pageTitle={pageTitle} path={pagePath} description={pageDescription} noindex> |
| 10 | + <section class="mx-auto mb-6 max-w-3xl space-y-3 text-lg text-offset"> |
| 11 | + <p> |
| 12 | + Use this fixture to verify the client-side environment utility output without depending on marketing routes. |
| 13 | + </p> |
| 14 | + <p data-testid="environment-client-notice"> |
| 15 | + Once the page hydrates, the JSON snapshot below is mirrored to <code>window.environmentClientSnapshot</code>. |
| 16 | + </p> |
| 17 | + </section> |
39 | 18 |
|
40 | | - window.environmentClientSnapshot = snapshot |
| 19 | + <section class="mx-auto max-w-3xl"> |
| 20 | + <pre |
| 21 | + id="environment-client-json" |
| 22 | + class="overflow-auto rounded border border-border bg-bg-offset p-4 font-mono text-sm text-text" |
| 23 | + >Collecting client environment data…</pre> |
| 24 | + </section> |
41 | 25 |
|
42 | | - const output = document.getElementById('environment-client-json') |
43 | | - if (output) { |
44 | | - output.textContent = JSON.stringify(snapshot, null, 2) |
45 | | - } |
46 | | - </script> |
47 | | - </body> |
48 | | -</html> |
| 26 | + <script type="module" is:inline> |
| 27 | + import { |
| 28 | + getPackageRelease, |
| 29 | + getPrivacyPolicyVersion, |
| 30 | + isDev, |
| 31 | + isE2eTest, |
| 32 | + isProd, |
| 33 | + isTest, |
| 34 | + isUnitTest, |
| 35 | + } from '@components/scripts/utils/environmentClient' |
| 36 | + |
| 37 | + const snapshot = { |
| 38 | + isUnitTest: isUnitTest(), |
| 39 | + isTest: isTest(), |
| 40 | + isE2eTest: isE2eTest(), |
| 41 | + isDev: isDev(), |
| 42 | + isProd: isProd(), |
| 43 | + packageRelease: getPackageRelease(), |
| 44 | + privacyPolicyVersion: getPrivacyPolicyVersion(), |
| 45 | + } |
| 46 | + |
| 47 | + window.environmentClientSnapshot = snapshot |
| 48 | + |
| 49 | + const output = document.getElementById('environment-client-json') |
| 50 | + if (output) { |
| 51 | + output.textContent = JSON.stringify(snapshot, null, 2) |
| 52 | + } |
| 53 | + </script> |
| 54 | +</BaseLayout> |
0 commit comments