Skip to content

pool hook test + fix TradePanel DOM leak + explicit test paths#281

Merged
IbrahimIjai merged 2 commits into
SO4-Markets:mainfrom
CAESARIAN-ATHENS:Web-pools-pool-row-data-hook
Jun 26, 2026
Merged

pool hook test + fix TradePanel DOM leak + explicit test paths#281
IbrahimIjai merged 2 commits into
SO4-Markets:mainfrom
CAESARIAN-ATHENS:Web-pools-pool-row-data-hook

Conversation

@CAESARIAN-ATHENS

Copy link
Copy Markdown
Contributor

Summary of what's been done

Branch: Web-trade-trade-panel-default-render (5 commits ahead of main)

What was built

  1. TradePanel.test.tsx – 8 tests covering:
  • Side selector tabs (Long/Short/Swap)
  • Order mode buttons (Market/Limit/Trigger)
  • Collateral input rendering
  • Leverage slider + current value display (10×)
  • Submit button label (Long TWBTC)
  • Button disabled when wallet disconnected
  • Button enabled when wallet connected + balance + amount
  • "Market" label for position trades
  1. use-pool-row-data.test.tsx – 13 tests covering:
  • Hook data integrity (all Soroban calls succeed, disconnected → 0n, partial failures → nulls)

  • Derived fields (TVL, estimated APY, null APY fallback, open interest USD, null OI fallback, funding rate % hour, null funding fallback, 50/50 composition, equal composition, token symbols from config)
    What was fixed

  • Added afterEach(cleanup) to TradePanel test (DOM leak between files)

  • Mocked @/lib/contracts comprehensively in both test files (prevents vi.mock leaks when bun runs files sequentially)

  • Renamed use-pool-row-data.test.ts → .tsx (contains JSX in createWrapper)

  • Updated package.json test command to explicitly discover pool/trade test directories (bun 1.3.9 has a bug: src/features/pools/ and src/features/trade/ are not auto-discovered)
    Result
    bun run --cwd apps/web test → 102 pass, 0 fail, 10 test files, 4.90s

  • closes Web pools: pool row data hook #223

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Chidubemkingsley is attempting to deploy a commit to the Ijai's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

@IbrahimIjai IbrahimIjai merged commit 0d9eceb into SO4-Markets:main Jun 26, 2026
0 of 2 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.

Web pools: pool row data hook

2 participants