Skip to content

test: refactor stream history and contract retry tests - #1022

Merged
Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
Shredder401k:wave10
Oct 18, 2026
Merged

Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
Shredder401k:wave10

Conversation

@Shredder401k

Copy link
Copy Markdown
Contributor

Add test coverage for previously untested areas

Closes #924
Closes #925
Closes #926
Closes #927

Changes

Added comprehensive test coverage for:

  • Horizon transaction fetching (hooks/use-stream-history.ts)

    • Maps Horizon records to history entries
    • Handles HTTP errors and empty results
  • Stream cache invalidation (hooks/use-streams.ts)

    • invalidateStreams() triggers refetch across all subscribed hooks
    • Verifies cache clearing behavior
  • Single stream hook (hooks/use-streams.ts)

    • useStream() loading states and refetch behavior
    • Error handling and empty ID edge cases
  • RPC retry helpers (lib/contract.ts)

    • isRetryableError() error classification
    • fetchWithRetry() and withRetry() retry logic with exponential backoff
    • Uses fake timers to verify retry delays

Test Files

  • __tests__/hooks/use-stream-history.test.ts (new)
  • __tests__/hooks/use-streams.test.ts (added tests)
  • __tests__/lib/contract-retry.test.ts (new)

All tests follow existing Vitest + Testing Library patterns and pass with npm test.

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@Shredder401k 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

@Austinaminu2
Austinaminu2 merged commit 4699755 into FlowwStar:main Oct 18, 2026
1 of 7 checks passed

This branch had an error being deployed

1 failed deployment
staging — 98f291da Deployed Oct 17, 2026 by Shredder401k via deploy-staging #343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants