فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(security): guard confirmation labels against HTML injection
davoodmehraban89 committed
Oct 30, 2026 at 23:58 UTC
5040d9457e2e6b89fe2280d763530c656f2a21c6
1 file changed
+4
tests/ui-control-structure.test.mjs
+4
@@ -100,6 +100,10 @@ test('Q01: shared dialogs have ARIA naming, keyboard dismissal and focus restora
100
'untrusted confirmation messages must be assigned as text, not HTML');
101
assert.doesNotMatch(code, /\$\{message\}<\/p>/,
102
'financial confirmation message must never be interpolated into innerHTML');
103
+ assert.match(code, /cancelButton\.textContent = String\(cancelText \?\? ''\)/);
104
+ assert.match(code, /confirmButton\.textContent = String\(confirmText \?\? ''\)/);
105
+ assert.doesNotMatch(code, /\$\{(?:cancelText|confirmText)\}<\/button>/,
106
+ 'confirmation button labels must never become executable markup');
107
assert.match(code, /addEventListener\('keydown'/);
108
assert.match(code, /removeEventListener\('keydown'/);
109
});