Skip to content

Test/reputation 15 reputationprofile branches#665

Closed
Thosine-01 wants to merge 5 commits into
Talenttrust:mainfrom
Thosine-01:test/reputation-15-reputationprofile-branches
Closed

Test/reputation 15 reputationprofile branches#665
Thosine-01 wants to merge 5 commits into
Talenttrust:mainfrom
Thosine-01:test/reputation-15-reputationprofile-branches

Conversation

@Thosine-01

@Thosine-01 Thosine-01 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends ReputationProfile.test.tsx to cover all rendering branches (no-reputation, score of 0, partial, full-history) and verifies the component's accessibility wiring,

What's covered

  • No reputationscore undefined renders "No reputation yet" / "Pending", no partial banner.
  • Score of 0 — treated as a real score (not "no reputation"); still triggers the partial banner since history is empty.
  • Partial state — score present, empty history: "Partial reputation data" banner and "Private by default" pill render correctly.
  • Full history — each ReputationEvent renders as its own list item; pill reads "Visible"; verified violation-free with jest-axe.
  • Single-character name — avatar renders the uppercased initial.
  • Accessibility — confirmed aria-labelledby associations between the score/level values and their labels resolve to the correct label elements, and the sr-only profile heading is present and correctly associated via the section's aria-labelledby.

No source changes were needed — ReputationProfile.tsx's existing hasReputation check (typeof score === 'number' && score >= 0) already correctly handles score === 0; this PR adds a regression test to make sure it stays that way.

Reused the existing exported ReputationEvent / ReputationProfileProps types rather than duplicating them.

Added a short section to docs/components/Accessibility.md documenting the guarantees now covered by these tests.

#close(#476)

Test output

PASS src/components/tests/StatusBadge.test.tsx
PASS src/contexts/tests/WalletContext.test.tsx
PASS src/components/tests/EmptyState.test.tsx (5.131 s)
PASS src/lib/tests/preferences.test.tsx (5.292 s)
PASS src/components/tests/ActionPanel.test.tsx (5.644 s)
PASS src/components/tests/RouteAnnouncer.test.tsx
PASS src/components/settings/tests/SettingsPanel.test.tsx (6.784 s)
PASS src/components/tests/WalletConnectButton.test.tsx
PASS src/components/FormValidation.test.tsx
PASS src/components/toast/toast-provider.test.tsx
PASS src/components/SafeBoundary.test.tsx
PASS src/components/tests/ContractSummary.test.tsx
PASS src/components/tests/MilestonesList.test.tsx
PASS src/app/error.test.tsx
PASS src/app/page.test.tsx
PASS src/components/tests/a11y.test.tsx (8.383 s)
PASS src/app/milestones/tests/page.test.tsx
PASS src/lib/tests/truncateAddress.test.ts
PASS src/app/reputation/tests/page.test.tsx
PASS src/app/contracts/tests/page.test.tsx
PASS src/components/ReputationProfile.test.tsx
PASS src/app/contracts/[id]/tests/page.test.tsx
PASS src/app/not-found.test.tsx

Test Suites: 23 passed, 23 total
Tests: 172 passed, 172 total
Snapshots: 7 passed, 7 total
Time: 12.507 s

@Thosine-01

Copy link
Copy Markdown
Contributor Author

I'm not sure what happend to the first PR but i was assigned the issue by you i guess i made a mistake with closing the issue. please let me know your thought thank you

@mikewheeleer

Copy link
Copy Markdown
Contributor

thanks for pitching in @Thosine-01! this one's not assigned to you — apply for it first, and once you're the assignee reopen the PR. 🙂

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.

2 participants