Repository navigation
Closed
Labels
GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programhelp wantedExtra attention is neededtestingTesting/QA infrastructurevery hardVery difficult task, expert-level effort required
Description
Problem
This repo has zero test infrastructure — no test runner, no test files, and no test script in package.json (only dev, build, start, lint). For a financial application dealing with escrow-adjacent wallet signing, decimal money handling, and multi-step async claim/fund flows (see the other issues in this batch), shipping changes with no automated regression safety net is a significant, compounding risk: every future bug fix (including fixes for the other 29 issues filed alongside this one) is unverifiable except by manual clicking, and regressions in adapters.ts's numeric coercion or wallet.ts's error handling will not be caught before reaching production.
Why this is hard
- This isn't "add Jest and call it done" — Next.js 16 with Turbopack and React 19 has specific, still-evolving compatibility requirements for test runners (Vitest is generally the better-supported choice for Turbopack-based Next.js projects currently, but this needs verifying against the actual pinned
next/reactversions inpackage.json, not assumed). - Needs a real strategy split: pure-function unit tests (
src/lib/adapters.ts,src/lib/utils.ts,src/lib/wallet.ts's non-extension-dependent logic) are straightforward: component tests for Client Components that depend on@stellar/freighter-api(a browser extension API with no natural test double) require building a mock for the Freighter API surface: and Server Component data-fetching logic (thefetchXfunctions with mock fallback) needs a strategy for mockingfetchat the right layer without becoming brittle. - Must establish a coverage baseline and CI wiring (
.github/exists — check if there's already a workflow to extend or if one needs to be created) so tests actually run on every PR, not just exist locally, and must decide a realistic initial coverage target given the codebase's current size rather than an arbitrary "100%" that stalls the effort. - Should specifically prioritize writing tests for the highest-risk logic identified elsewhere (decimal/money handling, team-split validation, wallet network-mismatch handling) rather than starting with trivial UI snapshot tests that provide little real protection — this requires judgment about what's actually risky in this specific codebase, not boilerplate test scaffolding.
Scope
- Choose and set up a test runner compatible with the pinned Next.js 16/React 19/Turbopack versions; add the
testscript topackage.json. - Build a reusable mock for
@stellar/freighter-api's functions used inwallet.ts/WalletContext.tsx. - Write unit tests for all functions in
src/lib/adapters.tsandsrc/lib/utils.ts, covering the edge cases identified in the numeric-precision and team-split-validation issues in this batch. - Write tests for
wallet.ts's connect/sign error paths using the mock. - Wire test execution into CI (extend existing GitHub Actions workflow under
.github/or add one if none exists) so it runs on every PR. - Document the testing approach and coverage baseline in the PR description.
Acceptance criteria
npm testruns and passes locally and in CI on every PR.src/lib/adapters.tsandsrc/lib/wallet.tshave meaningful coverage of both happy paths and the edge/error cases identified in this issue batch.- CI fails a PR that breaks an existing test.
Metadata
Metadata
Assignees
Labels
GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programhelp wantedExtra attention is neededtestingTesting/QA infrastructurevery hardVery difficult task, expert-level effort required
Activity
AYOMI-cmd commentedon Aug 25, 2026
@AYOMI-cmd has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @AYOMI-cmd to this issue.
stephaniepez21-art commentedon Aug 25, 2026
@stephaniepez21-art has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @stephaniepez21-art to this issue.
luciachizaram commentedon Aug 25, 2026
@luciachizaram has applied to work on this issue as part of the Stellar Wave Program's 8th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @luciachizaram to this issue.
drips-wave commentedon Aug 25, 2026
Congratulations, @luciachizaram! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.
🧑💻 @luciachizaram: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
drips-wave commentedon Aug 25, 2026
This issue has been completed by @luciachizaram as part of the Stellar Wave Program's 8th Wave 🥳
😎 @luciachizaram: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.