Skip to content

Feat/issue 293 a11y audit#381

Open
Lansa-18 wants to merge 3 commits into
ChainForgee:mainfrom
Lansa-18:feat/issue-293-a11y-audit
Open

Feat/issue 293 a11y audit#381
Lansa-18 wants to merge 3 commits into
ChainForgee:mainfrom
Lansa-18:feat/issue-293-a11y-audit

Conversation

@Lansa-18

Copy link
Copy Markdown
Contributor

Closes #293

feat(a11y): WCAG 2.2 AA Audit, Axe Test Suite, and Frontend CI (#293)

Summary

Delivers the accessibility audit and CI-enforced axe test suite requested in the issue. Adds a written WCAG 2.2 AA audit, an axe-core jest suite covering 5 page states, a new frontend CI workflow, and the minimal a11y fixes needed to make the suite pass.

Route discrepancy: the issue names /claims/[id], which does not exist in the frontend. The closest page, /[locale]/claim-receipt?claimId=, was audited in its place (documented in the audit doc; creating the real route is backlog ticket #5).


What This Adds

1. Written WCAG 2.2 AA Audit — docs/accessibility/audit-2026.md

Per-page pass/fail tables for /, /campaigns, /claim-receipt, and cross-cutting concerns (root layout/Navbar), plus a 9-item copy-paste-ready ticket backlog covering: skip link, per-locale <html lang>, browser-based contrast/focus pass, non-functional "Learn More" button, real /claims/[id] route, and more. Per the issue, findings become tickets — only the minimal fixes below are made here.

2. Axe-core Jest Suite — app/frontend/test/accessibility.spec.tsx

Renders 5 page states and asserts zero axe violations:

State Notes
Home
Campaigns as NGO
Campaigns as guest (Access Denied)
Claim-receipt loaded
Claim-receipt error

Data hooks and next/navigation are mocked with deterministic fixtures. The color-contrast rule is disabled because jsdom has no layout engine (contrast is tracked as a manual browser pass in the audit). File is .tsx rather than the issue's .ts because it renders JSX.

3. Frontend CI Workflow — .github/workflows/frontend-ci.yml

No CI workflow existed previously. Runs lint → type-check → test on frontend paths, satisfying the "axe test runs in CI" acceptance criterion. The lint step is temporarily continue-on-error because main carries 14 pre-existing lint errors unrelated to this branch (making it blocking is backlog ticket #9).

4. Minimal A11y Fixes (so the suite passes)

File Fix
Home / AidPackageList Fixed h1→h3 heading skips (h3→h2, card h4→h3); Tailwind classes unchanged, no visual shift
Claim-receipt role="status" on the loading block, role="alert" on the error block, aria-hidden on the spinner/alert icons and the glyph
Campaigns <main> landmark on the Access Denied branch; form feedback now typed success/error and rendered with role="status"/role="alert"

5. Prerequisite Fix (separate commit)

root package.json contained invalid JSON (trailing comma in scripts) that broke every workspace pnpm command.


Testing

# Full frontend suite (11 suites, 99 tests — includes the 5 new axe assertions)
pnpm --filter chainforge-frontend run test
# → Test Suites: 11 passed, Tests: 99 passed

# Type check
pnpm --filter chainforge-frontend run type-check   # clean

# CI steps replicated locally exactly as frontend-ci.yml runs them
pnpm install --no-frozen-lockfile --engine-strict=false
pnpm --filter chainforge-frontend run lint
# fails only on 14 pre-existing errors from main (non-blocking in CI)

Negative control: temporarily reverting one heading fix makes the suite fail with axe's heading-order rule, proving the axe scan is actually enforcing (fix restored afterward).

Post-merge check: after merging the latest main (new locales + CSP reporting), the full suite and type-check were re-run green.


Screenshots

No visual changes — heading elements changed tag but kept their exact Tailwind classes, and the added ARIA roles/landmarks are invisible. Spot-checked /en, /en/campaigns (NEXT_PUBLIC_USER_ROLE=ngo), and /en/claim-receipt?claimId=x render identically.


Checklist

  • Tests added or updated for new/changed behavior
  • Existing tests pass
  • No secrets, keys, or seed phrases committed
  • Follows the coding conventions in the relevant service README
  • PR is focused on a single concern

@Lansa-18

Copy link
Copy Markdown
Contributor Author

@kilodesodiq-arch Kindly review. All CI checks passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility audit: WCAG 2.2 AA cross-cutting fixes

1 participant