@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 7b30ac1
Fork 0

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

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 17:00 UTC

test: pin keyboard search and F2 bundle in UX invariants

davoodmehraban89 committed Oct 12, 2026 at 00:03 UTC 7b30ac1dec7f7252be45eba1004830587df72a09
1 file changed +3 -1
scripts/ux-hardening-r2-check.mjs
+3 -1
@@ -8,7 +8,7 @@ const purchases=fs.readFileSync('js/purchases.js','utf8');
8 const commerce=fs.readFileSync('js/commercial-rnd.js','utf8');
9 const print=fs.readFileSync('js/print.js','utf8');
10 const ok=(v,m)=>{if(!v)throw new Error(m)};
11 -ok(index.includes('js/ux-hardening-r2.js?v=20261011-modal-close-v4'),'UX R2 module must be loaded.');
11 +ok(index.includes('js/ux-hardening-r2.js?v=20261011-combo-keyboard-f2-v5'),'UX R2 module must be loaded.');
12 ok(projects.includes('getMyGlobalProjects')&&projects.includes('attachExistingProject')&&projects.includes('linkedContactIds'),'Counterparty project management must reuse global project master data.');
13 ok(projects.includes('createAndAttachProject')&&projects.includes('openProjectAttachModal'),'Counterparty project UI must support select-existing or create-new in place.');
14 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,6 +16,8 @@ ok(invoices.includes('data-search=')&&purchases.includes('data-search='),'Produc
16 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(purchases.includes("projectId,projectName,costCenterId:''")&&!purchases.includes("projectId:source.costCenterId"),'Purchase project must be independent from cost-center semantics.');
18 ok(ux.includes("navigateShell('commerce','view-purchases')")&&ux.includes("navigateShell('commerce','view-invoices')"),'Purchase/sale switching must preserve Commerce shell.');
19 +ok(ux.includes("e.key==='F2'")&&ux.includes('function f2ConfirmCurrentForm')&&ux.includes('finoraConfirmActiveFormF2'),'F2 must save active forms through supported validation without implicit posting.');
20 +ok(ux.includes("e.key==='ArrowDown'")&&ux.includes("e.key==='ArrowUp'")&&ux.includes('aria-activedescendant')&&ux.includes("e.key==='Enter'")&&ux.includes("list.addEventListener('wheel'"),'Select lists must support highlighted arrow/wheel navigation and Enter.');
21 ok(ux.includes('hotkey_ctrl_s')&&ux.includes('hotkey_ctrl_enter')&&ux.includes('hotkey_enter_save')&&ux.includes('hotkey_quick_zeros'),'Keyboard settings are incomplete.');
22 ok(ux.includes("ui_theme||'auto'")&&ux.includes('finora-theme-dark'),'Light/dark/auto theme support is missing.');
23 ok(ux.includes('excel_template_fields')&&ux.includes('finoraDownloadConfiguredTemplate')&&ux.includes('finoraExportConfiguredData'),'Configurable Excel templates/exports are missing.');