@davoodmehraban89 / Factor-easy / commits / 19fc097
Fork 0

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

test: assert product prices refresh only after server posting

davoodmehraban89 committed Nov 17, 2026 at 17:21 UTC 19fc0977fd5adf83d996a137e49e29cd36ba4bcb
1 file changed +1 -1
scripts/ux-hardening-r2-check.mjs
+1 -1
@@ -14,7 +14,7 @@ ok(projects.includes('getMyGlobalProjects')&&projects.includes('attachExistingPr
14 ok(projects.includes('createAndAttachProject')&&projects.includes('openProjectAttachModal'),'Counterparty project UI must support select-existing or create-new in place.');
15 ok(ux.includes('select.options.length<8')&&ux.includes('finora-combobox-input')&&ux.includes('finora-combobox-option')&&!ux.includes('finora-select-search'),'Large selectors must use one integrated searchable combobox, not a separate search field plus select.');
16 ok(invoices.includes('data-search=')&&purchases.includes('data-search='),'Product selectors must search code/name/spec/ids.');
17 -ok(products.includes('function syncProductDefaultPrices')&&invoices.includes("syncProductDefaultPrices(inv.items,'sale')")&&purchases.includes("syncProductDefaultPrices(items,'purchase')"),'Posted sale and saved purchase prices must refresh product defaults; sales drafts must not mutate master prices.');
17 +ok(products.includes('function syncProductDefaultPrices')&&invoices.includes("syncProductDefaultPrices(savedInvoice.items,'sale')")&&purchases.includes("syncProductDefaultPrices(savedPurchase.items,'purchase')"),'Only server-confirmed posted sale/purchase documents may refresh product default prices; sales drafts must not mutate master prices.');
18 ok(purchases.includes("projectId,projectName,costCenterId:''")&&!purchases.includes("projectId:source.costCenterId"),'Purchase project must be independent from cost-center semantics.');
19 ok(ux.includes("navigateShell('commerce','view-purchases')")&&ux.includes("navigateShell('commerce','view-invoices')"),'Purchase/sale switching must preserve Commerce shell.');
20 ok(ux.includes("e.key==='F2'")&&ux.includes('function f2ConfirmCurrentForm')&&ux.includes('finoraConfirmActiveFormF2'),'F2 must save active forms through supported validation without implicit posting.');