Skip to content

test(reputation): add unit test coverage for reputation/[handle]/page.tsx (#412) - #448

Open
PINYOPATTANAWASANPORN wants to merge 1 commit into
MergeFi:mainfrom
PINYOPATTANAWASANPORN:test/reputation-page-coverage-412
Open

PINYOPATTANAWASANPORN wants to merge 1 commit into
MergeFi:mainfrom
PINYOPATTANAWASANPORN:test/reputation-page-coverage-412

Conversation

@PINYOPATTANAWASANPORN

Copy link
Copy Markdown

Summary of Changes

  • Add comprehensive test suite src/app/reputation/[handle]/page.test.tsx for ReputationPage and generateMetadata.
  • Cover case-insensitive mock profile fallback resolution in both generateMetadata and default page component export (guarding against Reputation profile lookups are case-sensitive, so a URL with different letter casing than the stored GitHub username 404s even though the profile exists #245 case-sensitivity regressions).
  • Cover generateMetadata title/description construction and missing profile fallback metadata.
  • Cover complete UI rendering of profile identity, badges, statistical metrics, and average review times.
  • Cover both independent empty state branches: organizations.length === 0 ("No contributions recorded yet.") and languages.length === 0 ("No data yet.").
  • Cover notFound() invocation when the target handle cannot be resolved.

Root Cause / Technical Context

  • src/app/reputation/[handle]/page.tsx had no test coverage despite handling case-insensitive profile lookups across two entry points (generateMetadata and default page component), two distinct empty state branches, and notFound() routing.
  • This PR introduces isolated unit tests ensuring both metadata and page rendering remain robust against regressions.

Verification & Testing

  • Validated diff clean of unintended changes or CRLF line endings.
  • Verified test coverage for:
    • generateMetadata: resolved profile title & description, uppercase handle lookup, null profile fallback.
    • ReputationPage: standard profile rendering, uppercase handle resolution via mock fallback, empty organizations message, empty languages message, and notFound() call on non-existent users.

Closes #412

….tsx (MergeFi#412)

- Cover case-insensitive mock profile fallback lookup in generateMetadata and default export
- Cover profile metadata construction and missing profile metadata fallback
- Cover rendering of handle, organizations, languages, and statistical cards
- Cover empty state branches for empty organizations and empty languages arrays
- Cover notFound() invocation when profile cannot be resolved
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

@PINYOPATTANAWASANPORN is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

reputation/[handle]/page.tsx has no test file despite its duplicated case-insensitive lookup and two independent empty-state branches

1 participant