سامانه صدور فاکتور و حسابداری
test(login): require independent executable asset and manifest checks
davoodmehraban89 committed
Oct 12, 2026 at 23:12 UTC
7443a167d3c965484ab8566e4041d3dbf09c2d4d
1 file changed
+6
-2
scripts/login-connectivity-check.mjs
+6
-2
@@ -6,9 +6,9 @@ const diagnostic=fs.readFileSync('js/login-connectivity.js','utf8');
6
assert(html.includes('id="auth-connectivity-check"'),'Missing diagnostic action');
7
assert(html.includes('id="auth-connectivity-result"'),'Missing accessible result');
8
assert(html.includes('id="auth-connectivity-result" aria-live="polite"'),'Diagnostic must announce updates without adding a conflicting global role=status');
9
-assert(html.includes('js/login-connectivity.js?v=20261011-login-triage-v1'),'Missing versioned script');
9
+assert(html.includes('js/login-connectivity.js?v=20261012-site-probe-v2'),'Missing versioned script');
10
assert(html.includes('js/core.js?v=20261012-login-wiring-v3'),'Production login controls must use new cache version');
11
-assert(html.indexOf('<script src="js/login-connectivity.js?v=20261011-login-triage-v1"')<html.indexOf('<script src="js/core.js?v=20261012-login-wiring-v3"'),'Connectivity handler script must execute before core (not just preload)');
11
+assert(html.indexOf('<script src="js/login-connectivity.js?v=20261012-site-probe-v2"')<html.indexOf('<script src="js/core.js?v=20261012-login-wiring-v3"'),'Connectivity handler script must execute before core (not just preload)');
12
assert(html.includes('js/bootstrap.js?v=20261012-login-ready-v2'),'Parallel bootstrap must also be cache-busted');
13
assert(html.includes('id="auth-login-button"')&&html.includes('id="auth-login-status"'),'Login control requires real readiness/progress feedback');
14
assert(core.includes('window.FinoraAppAssetsReady'),'Authenticated workspace must remain gated until all module scripts settle');
@@ -19,6 +19,10 @@ assert(!core.includes('اتصال اینترنت/VPN را بررسی کنید'),
19
assert(diagnostic.includes("'/auth/v1/health'"),'Must test the real GoTrue health path');
20
assert(diagnostic.includes('apikey:SUPABASE_KEY'),'Health check requires public API key');
21
assert(diagnostic.includes("new URL('manifest.json',document.baseURI)"),'Missing same-origin site baseline');
22
+assert(diagnostic.includes("new URL('js/login-connectivity.js?v=20261012-site-probe-v2',document.baseURI)"),'Missing same-origin executable asset probe');
23
+assert(diagnostic.includes("SITE_JS")&&diagnostic.includes("MANIFEST"),'Must diagnose executable asset and manifest independently');
24
+assert(diagnostic.includes("site-warning"),'Manifest-only error must not be misreported as total site failure');
25
+assert(!diagnostic.includes("if(!siteOk)"),'Legacy manifest-only SITE_UNREACHABLE classifier must be removed');
26
assert(!diagnostic.includes('signInWithPassword')&&!diagnostic.includes('auth-password'),'Diagnostic must not touch credentials');
27
assert(diagnostic.includes('new AbortController()'),'Probe timeout must be bounded');
28
console.log('PASS: login connectivity diagnostics are read-only, cache-versioned and credential-free');