سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 20:45 UTC
test(stage3): give legacy OFF fixture synthetic guard scope only after login
davoodmehraban89 committed
Oct 23, 2026 at 14:56 UTC
463a40c99b05adcb18071ab4dcb9d4f487f26b98
1 file changed
+5
-1
scripts/accounting-document-workflow.spec.js
+5
-1
@@ -67,7 +67,7 @@ async function authenticatedMockBrowser(page){
67
window.__f0Alerts=[];
68
window.alert=m=>window.__f0Alerts.push(String(m));
69
window.confirm=()=>false;
70
- fetchCurrentUser=async()=>({id:'FINORA_F0_FIXTURE_ONLY',username:'qa-only',email:'qa@example.invalid',fullName:'QA F0',organizationId:'11111111-1111-4111-8111-111111111111',role:'admin',maxCompanies:2,subscription:{type:'lifetime',status:'active',endDate:'2099-12-31'}});
70
+ fetchCurrentUser=async()=>({id:'FINORA_F0_FIXTURE_ONLY',username:'qa-only',email:'qa@example.invalid',fullName:'QA F0',role:'admin',maxCompanies:2,subscription:{type:'lifetime',status:'active',endDate:'2099-12-31'}});
71
maybeMigrateLegacyData=()=>{};
72
sb.from=collection=>({
73
select:()=>({
@@ -81,6 +81,10 @@ async function authenticatedMockBrowser(page){
81
return await window.qaF0Write(args);
82
};
83
await enterApp({id:'FINORA_F0_FIXTURE_ONLY'});
84
+ // Once startup has completed using the legacy synthetic identity, supply
85
+ // an isolated guard lookup scope. Supplying a fake org BEFORE login would
86
+ // incorrectly trigger real membership onboarding / auth lock.
87
+ currentUser.organizationId='11111111-1111-4111-8111-111111111111';
88
// The isolated legacy QA fixture explicitly models a server-reported OFF
89
// flag; Stage 2.2 ENFORCE is tested with real SQL + Chromium separately.
90
window.finoraManualGuardMode='off';