Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine): Mapping to SCs incorrect for ACT report #1721

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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