Skip to content

Commit

Permalink
Merge pull request #1721 from IBMa/act-report-bug
Browse files Browse the repository at this point in the history
fix(engine): Mapping to SCs incorrect for ACT report
  • Loading branch information
ErickRenteria authored Oct 18, 2023
2 parents cd93f79 + cdb10bd commit 98547b3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions accessibility-checker/test-act-w3/act.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,11 @@ async function getTestcases() {
async function getAssertion(ruleId, aceRules, result) {
const ruleset = await rulesetP;
let ruleTitle = "";
let scs = []
for (let aceRule of aceRules) {
if (aceRule.ruleId === ruleId) {
ruleTitle = `${aceRule.ruleId}:${aceRule.reasonIds.join(",")}`;
}
}
return {
"@type": "Assertion",
"test": {
"title": ruleTitle,
"isPartOf": ruleset.checkpoints
scs = scs.concat(ruleset.checkpoints
// Get checkpoints that have this rule
.filter(cp => (
cp.rules
Expand All @@ -101,9 +96,16 @@ async function getAssertion(ruleId, aceRules, result) {
rule.id === ruleId
// and either maps to all reasons, or one the these reasons is selected
&& (!rule.reasonCodes || rule.reasonCodes.filter(code => aceRule.reasonIds.includes(code)))
).length > 0)
)).length > 0
// Replace with the scId
)).map(cp => cp.scId)
)).map(cp => cp.scId));
}
}
return {
"@type": "Assertion",
"test": {
"title": ruleTitle,
"isPartOf": Array.from(new Set(scs))
},
"result": { "outcome": result }
}
Expand Down

0 comments on commit 98547b3

Please sign in to comment.