فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
fix(a11y): add accessible-label regressions
davoodmehraban89 committed
Oct 31, 2026 at 00:16 UTC
d4dfee2f5c478273eb1dbee49f6c7f21fe24caa1
1 file changed
+21
tests/ui-control-structure.test.mjs
+21
@@ -111,6 +111,27 @@ test('Q01: shared dialogs have ARIA naming, keyboard dismissal and focus restora
111
assert.match(code, /removeEventListener\('keydown'/);
112
});
113
114
+test('Q01: form labels are only associated within unambiguous modal groups', () => {
115
+ const modal=fs.readFileSync(path.join(root,'src','core','Modal.js'),'utf8');
116
+ const audit=fs.readFileSync(path.join(root,'tests','windows-vm-ui-interaction-audit-browser.js'),'utf8');
117
+ assert.match(modal, /_associateFormLabels\(card\)/);
118
+ assert.match(modal, /fields\.length !== 1/);
119
+ assert.match(modal, /labels\.length !== 1/);
120
+ assert.match(modal, /field\.labels\?\.length/);
121
+ assert.match(audit, /Modal form labels were missing, ambiguous, or overwrote explicit names/);
122
+ assert.match(audit, /expense-category-label-missing/);
123
+});
124
+
125
+test('Q01: primary search and filter controls have explicit accessible names', () => {
126
+ for (const [name, count] of [
127
+ ['InvoicesView',3],['ProductsView',2],['ContactsView',4],['ExpensesView',5]
128
+ ]) {
129
+ const source=fs.readFileSync(path.join(root,'src','views',name+'.js'),'utf8');
130
+ const names=[...source.matchAll(/aria-label="[^"]+"/g)];
131
+ assert.ok(names.length>=count, name+' lost search/filter accessibility labels');
132
+ }
133
+});
134
+
135
test('Q01: Escape is handled once for nested financial dialogs and shortcut target is topmost', () => {
136
const shortcuts = fs.readFileSync(path.join(root,'src','core','KeyboardShortcuts.js'),'utf8');
137
const modal = fs.readFileSync(path.join(root,'src','core','Modal.js'),'utf8');