Skip to content

test: cover StatCard states and accessibility - #687

Merged
Calebux merged 1 commit into
zintarh:mainfrom
ademolabiyi92-design:issue-422-statcard-tests
Oct 1, 2026
Merged

Calebux merged 1 commit into
zintarh:mainfrom
ademolabiyi92-design:issue-422-statcard-tests

Conversation

@ademolabiyi92-design

Copy link
Copy Markdown
Contributor

Overview

Add focused Jest and React Testing Library coverage for StatCard and fix the accessibility and layout issues the tests exposed.

Related Issue

Closes #422

Changes

  • Add seven tests for values, accessible names and descriptions, repeated labels, variants, decorative icons, loading transitions, and disabled/focus states.
  • Give repeated cards unique stable IDs, avoid a stale description reference while loading, and reserve description space to reduce layout shifts.
  • Use theme-aware foreground classes and fluid sizing for light/dark themes and narrow containers; preserve a visible focus state and respect reduced motion for the spinner.

Verification Results

Focused Jest suite: 7 passed
ESLint (changed files): passed
Strict TypeScript (changed files): passed
Prettier (changed files): passed
Repository-wide pnpm typecheck: fails on pre-existing errors outside StatCard, including missing test dependencies and page/API type errors
Acceptance Criteria Status
Jest + RTL rendering and state coverage Complete
Responsive/theme-aware classes and accessible labels/states Covered in component and unit tests
Browser-computed contrast and measured CLS Requires browser visual/performance check; JSDOM cannot verify computed CSS or layout
Strict TypeScript, centralized styling, no any or inline styles Complete

@vercel

vercel Bot commented Sep 25, 2026

Copy link
Copy Markdown

@ademolabiyi92-design is attempting to deploy a commit to the zintarh Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@ademolabiyi92-design Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ademolabiyi92-design
ademolabiyi92-design force-pushed the issue-422-statcard-tests branch 2 times, most recently from 0a951db to 3bab850 Compare September 29, 2026 14:16
@Calebux
Calebux merged commit 82eb1b8 into zintarh:main Oct 1, 2026
1 check failed
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.

Write unit tests for the StatCard component

2 participants