@diegovelasquezweb/a11y-engine 0.11.6 → 0.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -608,13 +608,18 @@ function deduplicateFindings(findings) {
|
|
|
608
608
|
if (group.length === 1) {
|
|
609
609
|
result.push(group[0]);
|
|
610
610
|
} else {
|
|
611
|
-
|
|
611
|
+
// Confirmed findings (needs_verification=false) always take priority over incomplete ones.
|
|
612
|
+
// Among confirmed, pick the one with most instances; same for incomplete-only groups.
|
|
613
|
+
const confirmed = group.filter((f) => !f.needs_verification);
|
|
614
|
+
const pool = confirmed.length > 0 ? confirmed : group;
|
|
615
|
+
const representative = pool.reduce((best, f) =>
|
|
612
616
|
(f.total_instances || 1) >= (best.total_instances || 1) ? f : best,
|
|
613
617
|
);
|
|
614
618
|
const affectedUrls = [...new Set(group.map((f) => f.url))];
|
|
615
619
|
const totalInstances = group.reduce((sum, f) => sum + (f.total_instances || 1), 0);
|
|
616
620
|
result.push({
|
|
617
621
|
...representative,
|
|
622
|
+
needs_verification: confirmed.length === 0,
|
|
618
623
|
total_instances: totalInstances,
|
|
619
624
|
pages_affected: affectedUrls.length,
|
|
620
625
|
affected_urls: affectedUrls,
|
|
@@ -1062,7 +1062,12 @@ async function runPa11yChecks(routeUrl, axeTags, sharedBrowser = null, includeWa
|
|
|
1062
1062
|
|
|
1063
1063
|
if (groupedByRule.has(ruleId)) {
|
|
1064
1064
|
// Add node to existing violation
|
|
1065
|
-
groupedByRule.get(ruleId)
|
|
1065
|
+
const existing = groupedByRule.get(ruleId);
|
|
1066
|
+
existing.nodes.push(node);
|
|
1067
|
+
// A confirmed error overrides warning-level needs_verification
|
|
1068
|
+
if (!isWarning) {
|
|
1069
|
+
existing.needs_verification = false;
|
|
1070
|
+
}
|
|
1066
1071
|
} else {
|
|
1067
1072
|
// Create new violation for this rule
|
|
1068
1073
|
groupedByRule.set(ruleId, {
|