فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

test(q01): observe route/theme/toast changes and exclude prompt-based company creation from modal sweep

davoodmehraban89 committed Oct 31, 2026 at 08:06 UTC 9e8527875d7f4d770efa3079370f57177cd698eb
1 file changed +9 -2
tests/windows-vm-ui-interaction-audit-browser.js
+9 -2
@@ -36,7 +36,7 @@
36 const safeFilter = /\.(?:_togglePreInvoice|_setStockFilter|_clearFilters|_applyCustom|refresh|setTheme)\s*\(/;
37 // These handlers only open an editor/preview/diagnostic dialog. The audit
38 // closes it without saving; a separate fixture-backed test owns commits.
39 - const safeOpen = /\.(?:openNewInvoice|openProductModal|openUnitModal|openCategoryModal|openContactModal|openExpenseModal|openChequeModal|openAccountModal|openReceiptModal|openPaymentModal|openTransferModal|openCompanyModal|openCompanySwitcher|openExportSectionModal|openSignedLicenseModal|openAuditTrail|openWipeModal|openRestoreModal|openPeriodModal|openJournalModal|openWarehouse|openStocktakeCreate|openTransfer|openReversal|_openQuickProduct|_openQuickContact|openLedger|openKardex|openStocktake|showJournal|editInvoice|editProduct|editContact|editCheque|editAccount|changeStatus|openAdjustModal|_printInvoice|printInvoice|createCompany|checkHolooMigrationReadiness|runFinancialDiagnostics)\s*\(/;
39 + const safeOpen = /\.(?:openNewInvoice|openProductModal|openUnitModal|openCategoryModal|openContactModal|openExpenseModal|openChequeModal|openAccountModal|openReceiptModal|openPaymentModal|openTransferModal|openCompanyModal|openCompanySwitcher|openExportSectionModal|openSignedLicenseModal|openAuditTrail|openWipeModal|openRestoreModal|openPeriodModal|openJournalModal|openWarehouse|openStocktakeCreate|openTransfer|openReversal|_openQuickProduct|_openQuickContact|openLedger|openKardex|openStocktake|showJournal|editInvoice|editProduct|editContact|editCheque|editAccount|changeStatus|openAdjustModal|_printInvoice|printInvoice|checkHolooMigrationReadiness|runFinancialDiagnostics)\s*\(/;
40 // A delete/close-period/seed action is safe to probe only up to its
41 // confirmation prompt. The audit must cancel and prove zero database writes.
42 const safeConfirm = /\.(?:deleteInvoice|deleteProduct|deleteContact|deleteCheque|deleteTransaction|deleteExpense|deleteAccount|closePeriod|seedChart)\s*\(/;
@@ -129,12 +129,19 @@
129 const row=all.get(k);
130 const before=target().innerHTML;
131 const beforeModal=!!document.querySelector('.modal-backdrop');
132 + const beforeRoute=FINORA.Router.current();
133 + const beforeTheme=document.documentElement.getAttribute('data-theme');
134 + const beforeToasts=[...document.querySelectorAll('.toast')].map(x=>x.textContent.trim()).join('|');
135 try {
136 el.click(); await wait(180);
137 if (!noError()) throw Error('error toast or page render error');
138 const after=target()?.innerHTML||'';
139 const afterModal=!!document.querySelector('.modal-backdrop');
137 - const changed = before !== after || beforeModal !== afterModal;
140 + const afterRoute=FINORA.Router.current();
141 + const afterTheme=document.documentElement.getAttribute('data-theme');
142 + const afterToasts=[...document.querySelectorAll('.toast')].map(x=>x.textContent.trim()).join('|');
143 + const changed = before !== after || beforeModal !== afterModal ||
144 + beforeRoute !== afterRoute || beforeTheme !== afterTheme || beforeToasts !== afterToasts;
145 clicks.push({route,section,category,label:name(el),
146 handler:handler(el).slice(0,170),changed,afterModal});
147 if (row) {row.status='clicked';row.reason=changed?'visible-state-changed':'no-observable-DOM-change';}