فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(ux): prevent regression in keyboard navigation, active menu semantics, persisted sidebar and focus styles
davoodmehraban89 committed
Oct 30, 2026 at 23:20 UTC
f8a0babe82fcee573d0b45260a06fd502669e1bb
1 file changed
+15
tests/ui-control-structure.test.mjs
+15
@@ -62,3 +62,18 @@ test('Q01: the native UI coverage runner must report unclicked controls explicit
62
assert.ok(!source.includes('localStorage.clear()') && !source.includes('wipeAll('),
63
'interaction audit must never clear the database in the installed VM');
64
});
65
+
66
+test('Q01: menu controls remain keyboard-reachable with synchronized screen-reader state', () => {
67
+ const shell = fs.readFileSync(path.join(root, 'index.html'), 'utf8');
68
+ const main = fs.readFileSync(path.join(root, 'src','main.js'), 'utf8');
69
+ const router = fs.readFileSync(path.join(root, 'src','core','Router.js'), 'utf8');
70
+ const styles = fs.readFileSync(path.join(root, 'src','styles','main.css'), 'utf8');
71
+ const navLinks = [...shell.matchAll(/<a href="#([a-z]+)" data-page="([a-z]+)"/g)];
72
+ assert.equal(navLinks.length, 10);
73
+ for(const match of navLinks) assert.equal(match[1], match[2]);
74
+ assert.match(shell, /id="sidebarToggleBtn"[^>]*aria-label="[^"]+"[^>]*aria-expanded="true"[^>]*aria-controls="sidebarMenu"/);
75
+ assert.match(main, /localStorage\.setItem\(SIDEBAR_COLLAPSED_KEY,/);
76
+ assert.match(main, /aria-expanded/);
77
+ assert.match(router, /aria-current/);
78
+ assert.match(styles, /:focus-visible/);
79
+});