Skip to content

Add tests for the EmptyState, KeyValueGrid, and PageHeading layout primitives #79

Description

@mikewheeleer

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

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.

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions