فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(ux): regress double-Escape nested dialog closure and keyboard configuration
davoodmehraban89 committed
Oct 30, 2026 at 23:35 UTC
e736f5ae7f2f59e585693aba840861f3d23a3a0c
1 file changed
+9
tests/ui-control-structure.test.mjs
+9
@@ -89,3 +89,12 @@ test('Q01: shared dialogs have ARIA naming, keyboard dismissal and focus restora
89
assert.match(code, /addEventListener\('keydown'/);
90
assert.match(code, /removeEventListener\('keydown'/);
91
});
92
+
93
+test('Q01: Escape is handled once for nested financial dialogs and shortcut target is topmost', () => {
94
+ const shortcuts = fs.readFileSync(path.join(root,'src','core','KeyboardShortcuts.js'),'utf8');
95
+ const modal = fs.readFileSync(path.join(root,'src','core','Modal.js'),'utf8');
96
+ assert.match(shortcuts, /window\.FINORA\?\.Modal\?\.stack\?\.length/);
97
+ assert.match(shortcuts, /backdrops\[backdrops\.length - 1\]/);
98
+ assert.match(modal, /shortcuts\.escapeCloses === false/);
99
+ assert.match(modal, /this\.close\(\)/);
100
+});