سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 17:00 UTC
test: avoid accounting mock auth race with delayed organization bootstrap
davoodmehraban89 committed
Oct 15, 2026 at 22:01 UTC
37ea886586e15728cce0a6a49a1c5a09a289eb5c
1 file changed
+6
-1
scripts/accounting-document-workflow.spec.js
+6
-1
@@ -35,7 +35,12 @@ async function installHarness(page,server){
35
}
36
async function authenticatedMockBrowser(page){
37
await page.goto(BASE,{waitUntil:'domcontentloaded'});
38
- await page.waitForFunction(()=>typeof enterApp==='function'&&typeof commitSaveInvoice==='function'&&typeof pullAll==='function');
38
+ // The synthetic account must not race the organization entitlement wrapper.
39
+ // Function availability precedes completion of asynchronously loaded ERP modules.
40
+ await page.waitForFunction(()=>typeof enterApp==='function'&&typeof commitSaveInvoice==='function'&&
41
+ typeof pullAll==='function'&&window.FinoraStartupStatus?.extensionsReady===true&&
42
+ window.FinoraStartupStatus?.failedExtensionCount===0&&
43
+ window.FinoraStartupStatus?.authChecked===true,{timeout:20000});
44
await page.evaluate(async()=>{
45
window.__FINORA_PRINT_TEST_MODE=true;
46
window.__f0Alerts=[];