Skip to content

Add RTL tests for MilestonesList rendering across all four statuses #65

@mikewheeleer

Description

@mikewheeleer

Description

src/components/__tests__/MilestonesList.test.tsx should comprehensively cover how MilestonesList.tsx renders Pending, Completed, Paid, and Disputed milestones, including payout formatting via the preferences provider. Add cases for the empty list, missing due dates, and the total count. This locks in the core milestone display behavior.

Requirements and context

  • Scoped to TalentTrust Talenttrust-Frontend (Next.js App Router + TS + Tailwind). Align with milestone/contract/reputation flows and the backend API.
  • Wrap the component with the preferences provider to assert formatAmount output.
  • Assert each status renders its badge and the count matches input length.
  • Must be accessible (WCAG 2.1 AA), responsive, tested, and documented. Concrete acceptance criteria: 95%+ coverage of the component logic.

Suggested execution

  • Fork the repo and create a branch:
    • git checkout -b test/milestones-list-coverage
  • Implement changes:
    • src/components/MilestonesList.tsx (real or new)
    • Tests: src/components/__tests__/MilestonesList.test.tsx (Jest + React Testing Library)
    • Docs: docs/components/MilestonesList.md
    • Ensure keyboard nav, focus states, ARIA, color-contrast, and responsive breakpoints

Test and commit

  • Run: npm test, npm run lint, npm run build
  • Cover edge cases (loading, empty, error, no-wallet, slow network, small screens)
  • Include screenshots/notes and a11y check results in the PR

Example commit message

test(ui): cover milestone statuses and formatting

Guidelines

  • Accessible (WCAG 2.1 AA), responsive, keyboard-navigable
  • Minimum 95% coverage on new/changed component logic
  • Clear documentation
  • Timeframe: 96 hours from assignment

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions