test(components): add Vitest unit tests for GroupCard, ContributionFo…#945
Merged
Xoulomon merged 1 commit intoMay 30, 2026
Merged
Conversation
…rm, TransactionHistory (Xoulomon#876)
|
@kimanicode 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Vitest + React Testing Library unit tests for
GroupCard,ContributionFlow, andTransactionHistory. 90 tests across 3 suites, all passing, with enforced coverage thresholds of ≥80% lines/functions and ≥70% branches.Motivation
No frontend component tests existed for the three major UI components. This adds a reliable, fast test suite that mocks all external dependencies (Soroban RPC, Horizon, wallet hooks) so component logic can be verified in isolation.
Closes #876
Type of change
feat— new featurefix— bug fixdocs— documentation onlyrefactor— code restructuring, no behaviour changetest— tests onlychore— build, deps, toolingperf— performance improvementChanges
frontend/src/test/GroupCard.test.tsx— 39 tests: static mode (all original tests preserved), fetch mode (loading/error/success via React Query), edge cases (description, image, className, status variants)frontend/src/test/ContributionFlow.test.tsx— 35 tests: initial state, validation, quick-select chips, confirmation dialog, success flow, error/retry, disabled state, custom min/max,onErrorcallbackfrontend/src/test/TransactionHistory.test.tsx— 16 tests: no-wallet state, type filter, Horizon fetch success/error/empty, custom address/contractId/pageSize/networkfrontend/vitest.config.ts— added coverage thresholds and ESM aliases for@creit.tech/stellar-wallets-kit/modules/*Testing
Smart contract:
cargo test -p stellar-saveFrontend:
Coverage report:
Expected: ≥80% lines, ≥80% functions, ≥70% branches across all three components.
Manual steps:
vitest.config.ts— CI will fail if they regressChecklist
cargo fmtrun (Rust changes)cargo clippy -- -D warningspasses (Rust changes)npm run lintpasses (frontend changes).envfiles stagedScreenshots / recordings
N/A — test-only change, no UI modifications.