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

fix(Q01): label contact tag input and expose safe native audit field diagnostics

davoodmehraban89 committed Oct 31, 2026 at 23:58 UTC 29dc7897ee5a315429c5a632411868df1ada878b
3 files changed +22 -2
src/views/ContactsView.js
+1 -1
@@ -333,7 +333,7 @@ class ContactsViewImpl {
333 <label class="form-label">برچسب‌ها</label>
334 <div id="tagsContainer">${tagsChips || '<small style="color:var(--text-muted)">هنوز برچسبی تعریف نشده</small>'}</div>
335 <div style="display:flex;gap:6px;margin-top:8px">
336 - <input type="text" class="form-control" id="newTagInput" placeholder="برچسب جدید..." style="flex:1" />
336 + <input type="text" class="form-control" id="newTagInput" aria-label="افزودن برچسب جدید" placeholder="برچسب جدید..." style="flex:1" />
337 <button class="btn btn-secondary" onclick="window.ContactsView.addNewTag()">➕</button>
338 </div>
339 </div>
tests/q01-contact-tag-a11y.test.mjs new
+16
@@ -0,0 +1,16 @@
1 +import test from 'node:test';
2 +import assert from 'node:assert/strict';
3 +import { readFileSync } from 'node:fs';
4 +
5 +test('Q01: existing tags never leave the add-new-tag input unnamed', () => {
6 + const source=readFileSync(new URL('../src/views/ContactsView.js', import.meta.url),'utf8');
7 + assert.match(source, /<input[^>]+id="newTagInput"[^>]+aria-label="افزودن برچسب جدید"/);
8 + assert.match(source, /class="tagCheckbox"/);
9 +});
10 +
11 +test('Q01: failing native field-label checks expose only safe field identities', () => {
12 + const source=readFileSync(new URL('./windows-vm-installed-tauri-cdp.cjs', import.meta.url),'utf8');
13 + assert.match(source,/audit\.fieldsWithoutLabels/);
14 + assert.match(source,/route: field\.route, section: field\.section/);
15 + assert.match(source,/id: field\.id, tag: field\.tag, type: field\.type/);
16 +});
tests/windows-vm-installed-tauri-cdp.cjs
+5 -1
@@ -469,7 +469,11 @@ async function connect(url) {
469 assert.ok(audit.fieldsInspected >= 15, 'Visible form-field inventory unexpectedly small');
470 assert.ok(Number.isInteger(audit.fieldsMissingProgrammaticLabel), 'No programmatic label coverage reported');
471 assert.equal(audit.fieldsMissingProgrammaticLabel, 0,
472 - 'Every visible financial input must have a programmatic label');
472 + 'Every visible financial input must have a programmatic label: ' +
473 + JSON.stringify((audit.fieldsWithoutLabels || []).map(field => ({
474 + route: field.route, section: field.section,
475 + id: field.id, tag: field.tag, type: field.type
476 + }))));
477 assert.ok(audit.safeClickCount >= 15, 'Safe interaction coverage unexpectedly low');
478 assert.equal(audit.uniqueActionFailed, 0, 'A native UI action click failed');
479 assert.equal(audit.brokenHandlerCount, 0, 'A visible control points to a missing handler');