feat: accessibility testing suite + fix 5 WCAG AA contrast failures#57
Merged
kryptodrex merged 4 commits intov.0.4.0from Mar 18, 2026
Merged
Conversation
…ary/react - Install @testing-library/react, @testing-library/user-event, jsdom, @testing-library/jest-dom - Add vitest.config.ts with jsdom environment and jest-dom setup - Add src/test/setup.ts for global test setup - Add 17 new component test files covering all shared UI primitives: - Button, Toggle, PillBadge, PillToggle, RadioGroup, FormGroup, FormattedNumberInput (controls) - Alert, Toast, InfoBox, ProgressBar, ConfirmDialog, ErrorDialog (feedback) - Modal, Banner, PageHeader, ViewModeSelector (layout) - All 278 tests pass (167 new component tests + 111 existing)" Co-authored-by: kryptodrex <25872870+kryptodrex@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add comprehensive UI-focused component testing suite
feat: add comprehensive UI component testing suite
Mar 18, 2026
Co-authored-by: kryptodrex <25872870+kryptodrex@users.noreply.github.com>
…ts, keyboard/ARIA tests - Fix 5 WCAG AA color-contrast failures in light theme (index.css + Toast.css) - Add src/test/colorContrast.ts: WCAG 2.1 utility functions - Add src/test/colorContrast.test.ts: 57 tests covering algorithm + all design token pairs - Add src/test/accessibility.test.tsx: 68 tests covering axe audits, ARIA, keyboard nav - Update src/test/setup.ts: register jest-axe toHaveNoViolations matcher - Add src/test/jest-axe.d.ts: vitest type augmentation for jest-axe" Co-authored-by: kryptodrex <25872870+kryptodrex@users.noreply.github.com>
Copilot
AI
changed the title
feat: add comprehensive UI component testing suite
feat: accessibility testing suite + fix 5 WCAG AA contrast failures
Mar 18, 2026
|
❌ Version File Not Updated The version file was not modified in this PR. Please update the |
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.
No accessibility-targeted tests existed. This adds WCAG 2.1 color-contrast validation, automated axe-core component audits, and keyboard/ARIA interaction tests — and fixes the real contrast failures those tests uncovered in the light theme.
CSS fixes (5 WCAG AA violations)
--alert-error-texton#fef2f2#dc2626#b91c1c--alert-warning-texton#fffbeb#d97706#92400e--alert-success-texton#f0fdf4#16a34a#166534toast-success-bg#10b981(light)white#111827toast-warning-bg#f59e0b(light)white#111827Dark theme already passed; no dark-mode changes needed.
New:
src/test/colorContrast.tsWCAG 2.1 utility library —
relativeLuminance,contrastRatio,meetsWcagAA/AAA, and theWCAGthreshold constants. No dependencies; pure algorithm.New:
src/test/colorContrast.test.ts— 57 testssRGBToLinear,hexToRgb,relativeLuminance,contrastRatio,meetsWcagAA)New:
src/test/accessibility.test.tsx— 68 testsThree layers:
toHaveNoViolations()role="status",aria-live="polite", heading levels, label association,namegrouping on radio groups, required indicatorsInfrastructure
src/test/setup.ts— registersjest-axetoHaveNoViolationsmatcher viaexpect.extendsrc/test/jest-axe.d.ts— vitestMatchersaugmentation fortoHaveNoViolations(avoids pulling in@types/jest-axewhich carries a conflicting jest type reference)💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.