Fix no-a11y-statement issue not being reported when statement is missing#104
Open
marcusosterberg wants to merge 3 commits into
Open
Fix no-a11y-statement issue not being reported when statement is missing#104marcusosterberg wants to merge 3 commits into
marcusosterberg wants to merge 3 commits into
Conversation
When a site has no accessibility statement, the plugin previously emitted an empty issues list and the page silently received a perfect score. This commit makes the missing-statement case visible to plugin-webperf-core so it can be scored correctly. Three interacting bugs are fixed: 1. checkNoAccessibilityStatement (and a duplicated block in getNextInterestingUrl) referenced this.groups[group]['knowledgeData']['url'], but knowledgeData is an array. The URL on the resulting issue was undefined. Use knowledgeData[0]['url'] with a fallback to the group's start-url. 2. When no statement was found, only 'no-a11y-statement' was added to knowledgeData.issues. The remaining rules (which the happy path adds as 'resolved') were missing, leaving plugin-webperf-core with no a11y category to score. Now the full rule set is populated, matching the shape produced when a statement is found. 3. checkNoAccessibilityStatement only ran during sitespeedio.summarize, but by then the per-page webPerfCoreSummary message had already been sent with empty issues. Re-publish webPerfCoreSummary for the first page after the missing-statement issue is added so plugin-webperf-core sees the updated state. The duplicated issue-creation block inside getNextInterestingUrl (triggered at the 15-URL cap) has been removed; checkNoAccessibilityStatement now owns this logic in a single place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sites without an accessibility statement were silently getting a perfect
score because the missing-statement issue never reached
plugin-webperf-core. This PR fixes three interacting bugs so the issue
is now correctly emitted and scored.
Bugs fixed
Wrong URL reference in checkNoAccessibilityStatement and
getNextInterestingUrl.
knowledgeDatais an array, sothis.groups[group]['knowledgeData']['url']was alwaysundefined.Fixed to use
knowledgeData[0]['url']with a fallback tostart-url.Incomplete rule set when no statement is found. Only
no-a11y-statementwas added; the other rules (added asresolvedon the happy path) were missing, so plugin-webperf-core had no
a11y category to compute. Now the full rule set is populated.
Issue added after per-page messages already sent.
webPerfCoreSummaryfor each page was emitted duringbrowsertime.har, butcheckNoAccessibilityStatementran later insitespeedio.summarize. The plugin now re-publishes the firstpage's
webPerfCoreSummaryafter the issue is added, soplugin-webperf-core sees it.
Also removed the duplicated issue-creation block inside
getNextInterestingUrl(at the 15-URL cap). The summarize-time pathnow owns this logic in one place.
Verification
Tested against two sites:
https://finsamornskoldsvik.se(no statement): now correctly producesa
no-a11y-statementissue with severitycritical, plus theremaining rules as
resolved, on both page and group level.https://eskilstuna.se(has a "delvis förenlig" statement):unchanged. Still produces
score.a11y: 90withcompatible-word-partlyas
errorand the rest asresolved.Related
Fixes <link to issue in Webperf-se/webperf_core>