Test the EmptyState, KeyValueGrid, and PageHeading rendering contracts
Description
src/components/EmptyState.tsx, src/components/KeyValueGrid.tsx, and src/components/PageHeading.tsx are presentational primitives reused across list and detail pages, but none has a test — so a regression in their optional action/description/rows props would go unnoticed. This issue adds coverage for all three.
Requirements and context
- Repository scope: Agentpay-Org/Agentpay-frontend only.
- EmptyState: assert title renders, optional
description and action render only when provided.
- KeyValueGrid: assert each row renders a
<dt>/<dd> pair with the given label/value and that an empty rows array renders nothing meaningful.
- PageHeading: assert the
<h1> title, optional description, and the action slot render.
- Use semantic queries (
getByRole/getByText) rather than class assertions.
Suggested execution
- Fork the repo and create a branch
git checkout -b test/testing-layout-primitives
- Implement changes
- Test and commit
Test and commit
- Run
npm run lint, npm run typecheck, and npm test.
- Cover edge cases: missing optional props, empty rows, and an action that is a link vs a button.
- Include the
npm test output and coverage for the three components.
Example commit message
test(components): cover EmptyState, KeyValueGrid, and PageHeading
Guidelines
- Minimum 95 percent test coverage for the three components.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.
Test the EmptyState, KeyValueGrid, and PageHeading rendering contracts
Description
src/components/EmptyState.tsx,src/components/KeyValueGrid.tsx, andsrc/components/PageHeading.tsxare presentational primitives reused across list and detail pages, but none has a test — so a regression in their optionalaction/description/rows props would go unnoticed. This issue adds coverage for all three.Requirements and context
descriptionandactionrender only when provided.<dt>/<dd>pair with the given label/value and that an empty rows array renders nothing meaningful.<h1>title, optional description, and theactionslot render.getByRole/getByText) rather than class assertions.Suggested execution
git checkout -b test/testing-layout-primitivessrc/components/__tests__/EmptyState.test.tsx,src/components/__tests__/KeyValueGrid.test.tsx, andsrc/components/__tests__/PageHeading.test.tsx.<dl>,<h1>).Test and commit
npm run lint,npm run typecheck, andnpm test.npm testoutput and coverage for the three components.Example commit message
test(components): cover EmptyState, KeyValueGrid, and PageHeadingGuidelines
Community & contribution rewards