Skip to content

Commit

Permalink
chore: remove unnecessary axe-config rules (#6449)
Browse files Browse the repository at this point in the history
#### Details

This PR:

* Updates the new `@accessibility-insights/axe-config` package to not
include an entry for `frame-tested`. We include this rule in AI4Web's
scans, but then post-process the results such that we don't present it
to users as an automated checks failure (we instead present it as a
special warning bar). This change means that a user relying on
axe-config won't include `frame-tested`, which will avoid the appearance
of issues reported by `axe-config` but not by automated checks.

##### Motivation

* Preparation for [using the axe-config output in
service](microsoft/accessibility-insights-service#2402)

##### Context

n/a

#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a"
in the checkbox -->
- [n/a] Addresses an existing issue: #0000
- [x] Ran `yarn fastpass`
- [x] Added/updated relevant unit test(s) (and ran `yarn test`)
- [x] Verified code coverage for the changes made. Check coverage report
at: `<rootDir>/test-results/unit/coverage`
- [x] PR title *AND* final merge commit title both start with a semantic
tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See
`CONTRIBUTING.md`.
- [n/a] (UI changes only) Added screenshots/GIFs to description above
- [n/a] (UI changes only) Verified usability with NVDA/JAWS
  • Loading branch information
dbjorge authored Mar 1, 2023
1 parent 006a780 commit 3fa6160
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/packages/axe-config/generate-config-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ const configFilePath = process.argv[2] || defaultConfigFilePath;
const generateAxeConfig = () => {
console.log('Generating axe config file...');

const ruleOverrides = explicitRuleOverrides;
ruleOverrides['frame-tested'] = {
status: 'excluded',
reason: `This is included by our scanner, but special cased during post-processing to
display a special warning bar rather than appearing with automated check results.
We omit it from @accessibility-insights/axe-config to avoid confusing disparities
between automated check results and external config users.`,
};

const ruleIncludedStatus = getRuleInclusions(axe._audit.rules, explicitRuleOverrides);
const scanParameterGenerator = new ScanParameterGenerator(ruleIncludedStatus);
const scanOptions = scanParameterGenerator.getAxeEngineOptions({});
Expand Down

0 comments on commit 3fa6160

Please sign in to comment.