fix: complete V09 financial diagnostic coverage in isolated QA

This commit is contained in:
2026-11-21 23:15:58 +02:00
parent 84018e3f25
commit 1349952d0f
36 changed files with 1245 additions and 29 deletions
+10 -5
View File
@@ -3,6 +3,7 @@ import {
correctionFieldHints,
correctionGroupMatches,
fieldLabelMatches,
normaliseFieldLabel,
revealCorrectionTarget,
} from '@/lib/field-corrections';
@@ -88,6 +89,10 @@ export default function PortalCorrections() {
[target(control, label || 'Campo indicado')],
);
}
const availableLabels = names.map(({ label }) => label);
const exactLabels = new Set(
availableLabels.map(normaliseFieldLabel),
);
for (const node of root.querySelectorAll<HTMLElement>(
'[data-correction-message],[role="alert"]',
)) {
@@ -102,13 +107,13 @@ export default function PortalCorrections() {
node.textContent?.replace(/\s+/g, ' ').trim() ||
'';
if (!message) continue;
const hints = correctionFieldHints(
message,
names.map(({ label }) => label),
);
const hints = correctionFieldHints(message, availableLabels);
const matches = names.filter(
({ label }) =>
label && hints.some((h) => fieldLabelMatches(label, h)),
label &&
hints.some((h) =>
fieldLabelMatches(label, h, exactLabels),
),
);
// Restrict explicit product/parcel/milestone/personnel diagnostics to the matching real group, if present.
const index =