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

test(a11y): guard visible financial dialog focus contract

davoodmehraban89 committed Oct 31, 2026 at 00:11 UTC 573b708012a5f234e9f0a6efff7f1bb975dcd8d8
1 file changed +5
tests/ui-control-structure.test.mjs
+5
@@ -96,6 +96,9 @@ test('Q01: shared dialogs have ARIA naming, keyboard dismissal and focus restora
96 assert.match(code, /event\.key === 'Escape'/);
97 assert.match(code, /event\.key !== 'Tab'/);
98 assert.match(code, /previousFocus\.focus/);
99 + assert.match(code, /const focusables = this\._focusable\(modal\.card\)/,
100 + 'initial focus must skip hidden financial inputs');
101 + assert.match(code, /focusables\.find\(el => el\.matches\('input, select, textarea'\)\)/);
102 assert.match(code, /\[data-confirm-message\]'\)\.textContent = String\(message \?\? ''\)/,
103 'untrusted confirmation messages must be assigned as text, not HTML');
104 assert.doesNotMatch(code, /\$\{message\}<\/p>/,
@@ -137,6 +140,8 @@ test('Q01: installed WebView2 must click synthetic modal Cancel/Confirm and trap
140 'syntheticConfirmRunsExactlyOnce:true',
141 'syntheticConfirmed!==0','syntheticConfirmed!==1',
142 'confirmationTextEscaped:true',
143 + 'visibleInputAutoFocused:true',
144 + 'Dialog initial focus landed outside first visible financial input',
145 'Confirmation message was interpreted as executable HTML',
146 'tabForward.defaultPrevented','tabBackward.defaultPrevented'
147 ]) assert.ok(audit.includes(check),'native modal control evidence missing: '+check);