Skip to content

test: add query key integration tests and placeholder hooks#473

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
wagmiiii:test/issue-459-query-keys
Jun 26, 2026
Merged

test: add query key integration tests and placeholder hooks#473
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
wagmiiii:test/issue-459-query-keys

Conversation

@wagmiiii

Copy link
Copy Markdown
Contributor

Summary

Closes #459

Adds the missing data-fetching hooks (as placeholders) and the requested integration test to guarantee query key consistency across the app.

What Changed

  • Added useCreators.ts exporting useCreatorList and useCreatorDetail
  • Added useWallet.ts exporting useWalletHoldings and useWalletActivity
  • Added queryKeyIntegration.test.tsx to assert strict cache-key equivalence with queryKeys.ts

Key Design Decisions

  • Missing Hooks: The hooks requested in the issue scope were missing from the codebase entirely. To fulfill the requirements of this integration test without inventing complex business logic, minimal placeholder hooks were created that strictly bind to the React Query constants.
  • Testing Approach: Tests capture the query key directly from the QueryClient cache upon component render to guarantee the key generated internally matches the exported constant perfectly.

Acceptance Criteria Checklist

  • Each hook's query key matches the corresponding constant
  • Test fails if a hook is updated to use a different key without updating the constant

Test Output & Coverage

 ✓ src/hooks/__tests__/queryKeyIntegration.test.tsx (4 tests) 74ms
   ✓ queryKeyIntegration (4)
     ✓ useCreatorList uses the correct query key constant 61ms
     ✓ useCreatorDetail uses the correct query key constant 4ms
     ✓ useWalletHoldings uses the correct query key constant 3ms
     ✓ useWalletActivity uses the correct query key constant 2ms

-----------------|---------|----------|---------|---------|-------------------
File             | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-----------------|---------|----------|---------|---------|-------------------
All files        |   92.85 |       50 |    92.3 |   92.85 |                   
 hooks           |     100 |      100 |     100 |     100 |                   
  useCreators.ts |     100 |      100 |     100 |     100 |                   
  useWallet.ts   |     100 |      100 |     100 |     100 |                   
-----------------|---------|----------|---------|---------|-------------------

Security Note

Placeholder hooks do not introduce new user inputs, network surface area, or hardcoded secrets.

Follow-Ups

  • Replace the queryFn placeholder promises with real API logic when the endpoints are finalized.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@wagmiiii Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit e15579e into accesslayerorg:dev Jun 26, 2026
1 check 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 integration test for React Query key constants used consistently across hooks

2 participants