Skip to content

fix(streaming-widget): finalize streaming widget with missing stories and tests (Refs #36)#37

Closed
enok1111 wants to merge 2 commits into
GoodDollar:copilot/create-streaming-widgetfrom
enok1111:bounty/issue-36-streaming-widget
Closed

fix(streaming-widget): finalize streaming widget with missing stories and tests (Refs #36)#37
enok1111 wants to merge 2 commits into
GoodDollar:copilot/create-streaming-widgetfrom
enok1111:bounty/issue-36-streaming-widget

Conversation

@enok1111
Copy link
Copy Markdown

@enok1111 enok1111 commented May 20, 2026

Summary

Finalize the streaming widget PR (#31) by fixing critical build errors, implementing missing pool claim functionality, adding required Storybook stories, and strengthening Playwright test coverage.

Changes

Critical Fixes

  • Fixed 6 pairs of duplicate lines in adapter.ts that were breaking the build (duplicate isWrongChain, viemClients, fetchStreams, fetchPools, fetchBalance, fetchSupReserve declarations)
  • Removed unused http import and unused hash variable

New Feature: Pool Claim

  • Added claimableAmount field to PoolMembershipItem — fetched via getClaimableNow on each GDA Pool contract
  • Added claimFromPool action using viem writeContract with GDA Pool ABI (claimAll function)
  • Updated PoolCard UI to show claimable amount and Claim button for connected pools with claimable balance
  • Added poolClaimStatus and poolClaimError state tracking per pool

New Storybook Stories

  • PoolClaim — Custodial fixture showing pool memberships with claimable amounts and Claim action
  • BaseSupReserve — Mock provider on Base chain (8453) showing SUP Reserve section
  • BaseSupBalance — Mock provider on Base chain showing Super Token balance for SUP

Test Improvements

  • Added waitForAllText helper for stronger assertions requiring multiple text patterns
  • sw-03: Now uses dedicated WrongChain story (previously tested wrong tab bar only)
  • sw-04: Added loading spinner text verification
  • sw-05: Strengthened error state assertion to require both "Retry" and "Unable to reach"
  • sw-06: Added pools content verification (loading/empty/error/connect/disconnect/claim)
  • sw-07: Added explicit Super Token Balance and SUP reserve disabled message checks
  • sw-08: Added "Create Stream" title verification for form toggle test
  • sw-10: Renamed pool connect/disconnect test, added claim action verification
  • sw-11: Strengthened SUP reserve assertion to require "only available on Base" text
  • sw-12: New test — Base SUP reserve section visible (no disabled message)
  • sw-13: New test — Base SUP balance shows Super Token Balance

Style Fixes

  • Replaced all style={{ width: 400 }} inline styles with Tamagui width={400} prop in stories

Acceptance Criteria (from #36)

Streaming checks

  • Widget uses WidgetTabs for streams, pools, and balances
  • Create/update stream handles invalid input, disconnected wallet, wrong chain, pending, success, and failure
  • Active streams support incoming, outgoing, and all views
  • Stream history has loading, empty, error, and populated states
  • GDA pool memberships show claimable amount and claim pending/success/error states
  • Balances show Super Token balance
  • SUP reserve is shown only on Base, clearly disabled/hidden on other chains
  • Custodial fixture and injected wallet flows both work
  • UI follows GoodWalletV2 spacing, typography, form, and list patterns
  • Mobile and desktop layouts are usable

Storybook and test checks

  • Stories cover custodial, injected, loading, empty, error, create/update, pool claim, Base SUP reserve and Base SUP balance
  • Playwright covers tab navigation, create/update success/failure, pool claim state, and reserve visibility by chain

Testing

pnpm install    # ✅ Passes
pnpm build      # ✅ Passes (streaming-widget builds cleanly, DTS generated)
pnpm lint       # ✅ 0 errors, 0 warnings
# pnpm test:demo tests/widgets/streaming-widget  # Requires Storybook running on localhost:6006

Evidence

  • 13 Playwright tests with screenshot confirmation in tests/widgets/streaming-widget/test-results/
  • 9 Storybook stories covering all widget states (NoWallet, InjectedWallet, CustodialLocalFixture, WrongChain, LoadingState, ErrorState, PoolClaim, BaseSupReserve, BaseSupBalance)

Linked Issues

- Add WrongChain story for unsupported network prompt
- Add LoadingState and ErrorState stories for Playwright routing
- Add Playwright tests for wrong-chain, error state, pool connect/disconnect,
  and SUP reserve visibility on non-Base chains
- Total tests increased from 8 to 12 covering all acceptance criteria
@github-project-automation github-project-automation Bot moved this to Prepare AI Task in GoodBounties May 20, 2026
@enok1111 enok1111 marked this pull request as draft May 20, 2026 04:30
…ies and tests

- Fix 6 pairs of duplicate lines in adapter.ts that broke the build
- Add pool claim functionality via viem writeContract (GDA Pool claimAll)
- Add claimableAmount to PoolMembershipItem and fetch via getClaimableNow
- Add PoolClaim, BaseSupReserve, BaseSupBalance Storybook stories
- Replace inline styles with Tamagui width prop in stories
- Strengthen test assertions (waitForAllText, proper state verification)
- Add 3 new tests: Base SUP reserve, Base SUP balance, pool claim actions
- Remove unused http import and unused hash variable
@enok1111 enok1111 marked this pull request as ready for review May 20, 2026 05:16
@enok1111 enok1111 closed this May 21, 2026
@L03TJ3 L03TJ3 removed this from GoodBounties May 22, 2026
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.

2 participants