fix: complete V09 financial diagnostic coverage in isolated QA
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user