test(audit): add dedicated test suite for a11y sub-check (follow-up #256)#296
Merged
Conversation
Third instance of the same pattern as export-snapshot (#218) and css-deep (#251): a11y_engine.py (WCAG 2.1 — missing alt/labels, ARIA, keyboard-nav, semantic HTML, color contrast, heading order, link text, focus management) is fully functional but its CLI entry point was deleted in the #195 consolidation, leaving audit_accessibility() reachable from nowhere. Verified the engine still works BEFORE wiring (per the issue constraint): 165 real findings on the Coretax smart-tax-assistance workspace. Restored as `audit --check a11y` — sub-check under the audit umbrella alongside dead-code/complexity/smell/css, NOT a new top-level command. Command count stays exactly 12 (verified via --command-count). New scripts/commands/a11y.py is a thin wrapper (no engine logic duplicated, mirrors css_deep.py). --severity/--category passthrough verified end-to-end: --category missing_alt narrows 165 -> 4.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
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.



Follow-up to #256 (a11y restore, already merged).
Summary
The a11y restoration merged without a dedicated test file —
test_command_registry.pyonly covers the allowlist, not the sub-check's actual behavior. This addstests/test_a11y_command.py(6 tests) and corrects the design doc's Testing section to match what was actually verified.audit_accessibility()--severity/--categorypassthrough (both at the wrapper and through audit's synthetic namespace)a11y(envelope shape,_checkmarker)css(feat(audit): restore css-deep as audit --check css (orphaned engine since #195) #251) anda11y(feat(audit): restore a11y as audit --check a11y (orphaned engine since #195, same as css-deep #251) #256) coexist in_CHECKSindependently — neither shadows the otherTest plan
pytest tests/test_a11y_command.py— 6/6 on latest mainaudit . --check a11y→ 165 findings (semantic_html 94, link_text 35, missing_label 24, keyboard_nav 5, missing_alt 4, color_contrast 3);--category missing_alt→ 4