@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / b42a6ce
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 04:15 UTC

test(login): enforce REST reachability and privacy-safe bootstrap progress diagnostics

davoodmehraban89 committed Oct 12, 2026 at 23:37 UTC b42a6ce69cab72c0602fdf94a5b1fa97be75f5b8
1 file changed +7 -4
scripts/login-connectivity-check.mjs
+7 -4
@@ -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=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=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)');
9 +assert(html.includes('js/login-connectivity.js?v=20261012-data-probe-v3'),'Missing versioned script');
10 +assert(html.includes('js/core.js?v=20261012-bootstrap-stages-v4'),'Production login controls must use new cache version');
11 +assert(html.indexOf('<script src="js/login-connectivity.js?v=20261012-data-probe-v3"')<html.indexOf('<script src="js/core.js?v=20261012-bootstrap-stages-v4"'),'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,8 +19,11 @@ 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');
22 +assert(diagnostic.includes("new URL('js/login-connectivity.js?v=20261012-data-probe-v3',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("'/rest/v1/'"),'PostgREST gateway probe required to distinguish data endpoint from Auth health');
25 +assert(diagnostic.includes('REST_UNREACHABLE')&&diagnostic.includes('rest-unreachable'),'PostgREST network failure must surface separately');
26 +assert(core.includes('FINORA_LOGIN_STEP_LABELS')&&core.includes('finoraPendingLoginStages'),'Timeout must identify fixed pending bootstrapping stages');
27 assert(diagnostic.includes("site-warning"),'Manifest-only error must not be misreported as total site failure');
28 assert(!diagnostic.includes("if(!siteOk)"),'Legacy manifest-only SITE_UNREACHABLE classifier must be removed');
29 assert(!diagnostic.includes('signInWithPassword')&&!diagnostic.includes('auth-password'),'Diagnostic must not touch credentials');