سامانه صدور فاکتور و حسابداری
test: stabilize isolated invoice fixture after async ERP bootstrap
davoodmehraban89 committed
Oct 16, 2026 at 11:14 UTC
82a09a17e661161e1180a1ff3c13ecd286866fed
1 file changed
+6
-1
scripts/phase0-invoice-persistence.spec.js
+6
-1
@@ -28,7 +28,12 @@ async function installHarness(page,server){
28
}
29
async function authenticatedMockBrowser(page){
30
await page.goto(BASE,{waitUntil:'domcontentloaded'});
31
- await page.waitForFunction(()=>typeof enterApp==='function'&&typeof commitSaveInvoice==='function'&&typeof pullAll==='function');
31
+ // Mock identity must be injected only after the async organization wrapper
32
+ // and all ERP extensions have finished installing. Test-only readiness guard.
33
+ await page.waitForFunction(()=>typeof enterApp==='function'&&typeof commitSaveInvoice==='function'&&
34
+ typeof pullAll==='function'&&window.FinoraStartupStatus?.extensionsReady===true&&
35
+ window.FinoraStartupStatus?.failedExtensionCount===0&&
36
+ window.FinoraStartupStatus?.authChecked===true,{timeout:20000});
37
await page.evaluate(async()=>{
38
window.__FINORA_PRINT_TEST_MODE=true;
39
window.__f0Alerts=[];