Skip to content

Add a unit test for the useNftMetadata fetch, error, and abort paths#1113

Merged
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-983
Jun 29, 2026
Merged

Add a unit test for the useNftMetadata fetch, error, and abort paths#1113
1nonlypiece merged 1 commit into
Commitlabs-Org:masterfrom
Baskarayelu:issue-983

Conversation

@Baskarayelu

Copy link
Copy Markdown
Contributor

Closes #983

Summary

  • Add src/hooks/__tests__/useNftMetadata.test.ts with 6 focused test cases
  • Covers the success (fetch) path with loading state transitions
  • Covers HTTP error responses (404) with error message assertions
  • Covers network errors surfaced as error strings
  • Covers abort path via DOMException AbortError
  • Covers the no-URL guard (does not call fetch, resets state)
  • Covers re-fetch on subsequent refresh() calls

Test plan

  • pnpm test src/hooks/__tests__/useNftMetadata.test.ts passes with all 6 tests green
  • No regressions in other hook tests

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Baskarayelu is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@1nonlypiece 1nonlypiece merged commit 9218b5e into Commitlabs-Org:master Jun 29, 2026
2 of 12 checks passed
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.

Add a unit test for the useNftMetadata fetch, error, and abort paths

2 participants