From 56325332bbd58fbe0bae65ebf01d0a1ad59ac9fb Mon Sep 17 00:00:00 2001 From: Dan Bjorge Date: Tue, 21 Feb 2023 19:09:29 -0500 Subject: [PATCH 1/3] remove unnecessary axe-config rules --- src/packages/axe-config/generate-config-json.ts | 9 +++++++++ src/scanner/get-rule-inclusions.ts | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/packages/axe-config/generate-config-json.ts b/src/packages/axe-config/generate-config-json.ts index 806f6b3278a..1011b83b13a 100644 --- a/src/packages/axe-config/generate-config-json.ts +++ b/src/packages/axe-config/generate-config-json.ts @@ -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({}); diff --git a/src/scanner/get-rule-inclusions.ts b/src/scanner/get-rule-inclusions.ts index 2de97d1769e..b706455e5a0 100644 --- a/src/scanner/get-rule-inclusions.ts +++ b/src/scanner/get-rule-inclusions.ts @@ -19,6 +19,10 @@ export const explicitRuleOverrides: DictionaryStringTo = { status: 'included', reason: 'for parity with video-caption, which axe-core includes by default', }, + bypass: { + status: 'excluded', + reason: "only reports needs-review results, but we haven't implemented needs-review content for it yet", + }, 'duplicate-id': { status: 'excluded', reason: 'Based on feedback from users we tested to check the user impact of duplicate ID failures on static elements. We found no user impact on the experience with any of the ATs including Narrator, JAWS, NVDA, Dragon, and Windows Speech Recognition. After further discussions with the Tooling Advisory Board, we decided to make this a best practice rule. See #4102.', From 8bca170dd6012e9e22992eaf01f38754e75482e3 Mon Sep 17 00:00:00 2001 From: Dan Bjorge Date: Tue, 21 Feb 2023 19:25:39 -0500 Subject: [PATCH 2/3] update rule inclusion snapshot --- .../scanner/__snapshots__/get-rule-inclusions.test.ts.snap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap b/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap index a4a5258bd53..ede344ea8d7 100644 --- a/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap +++ b/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap @@ -90,7 +90,8 @@ exports[`getRuleInclusions getRuleInclusions matches snapshotted list of product "status": "included", }, "bypass": { - "status": "included", + "reason": "only reports needs-review results, but we haven't implemented needs-review content for it yet", + "status": "excluded", }, "color-contrast": { "status": "included", From 761480de052e33f6bb65df1d125ec3305a65eb2c Mon Sep 17 00:00:00 2001 From: Dan Bjorge Date: Tue, 28 Feb 2023 17:30:04 -0500 Subject: [PATCH 3/3] revert removal of bypass rule --- src/scanner/get-rule-inclusions.ts | 4 ---- .../scanner/__snapshots__/get-rule-inclusions.test.ts.snap | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/scanner/get-rule-inclusions.ts b/src/scanner/get-rule-inclusions.ts index b706455e5a0..2de97d1769e 100644 --- a/src/scanner/get-rule-inclusions.ts +++ b/src/scanner/get-rule-inclusions.ts @@ -19,10 +19,6 @@ export const explicitRuleOverrides: DictionaryStringTo = { status: 'included', reason: 'for parity with video-caption, which axe-core includes by default', }, - bypass: { - status: 'excluded', - reason: "only reports needs-review results, but we haven't implemented needs-review content for it yet", - }, 'duplicate-id': { status: 'excluded', reason: 'Based on feedback from users we tested to check the user impact of duplicate ID failures on static elements. We found no user impact on the experience with any of the ATs including Narrator, JAWS, NVDA, Dragon, and Windows Speech Recognition. After further discussions with the Tooling Advisory Board, we decided to make this a best practice rule. See #4102.', diff --git a/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap b/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap index ede344ea8d7..a4a5258bd53 100644 --- a/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap +++ b/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap @@ -90,8 +90,7 @@ exports[`getRuleInclusions getRuleInclusions matches snapshotted list of product "status": "included", }, "bypass": { - "reason": "only reports needs-review results, but we haven't implemented needs-review content for it yet", - "status": "excluded", + "status": "included", }, "color-contrast": { "status": "included",