Add comprehensive test coverage (frontend + Rust)#739
Open
joshpainter wants to merge 2 commits intoxch-dev:mainfrom
Open
Add comprehensive test coverage (frontend + Rust)#739joshpainter wants to merge 2 commits intoxch-dev:mainfrom
joshpainter wants to merge 2 commits intoxch-dev:mainfrom
Conversation
Implements test infrastructure and ~268 new tests covering areas that previously had zero test coverage. Frontend uses Vitest with jsdom and Testing Library; Rust tests use in-memory SQLite and standard #[test]/#[tokio::test] patterns. Frontend (170 tests): - Vitest setup with Tauri IPC mocking (invoke, events, plugins) - Pure function tests: amount conversion, addresses, hex, formatting, URLs - WalletConnect schema validation for all 17 commands - Zustand store tests with mocked bindings - Handler tests for CHIP-0002, offers, and high-level commands Rust (98 tests): - sage-keychain: encrypt/decrypt round-trips, keychain CRUD, serialization - sage-database: blocks, offers, collections, mempool, type conversion utils - sage-config: config defaults/round-trip, network inheritance, v1 migration - sage parse: all parse_* functions (asset IDs, coins, hashes, signatures) CI: adds lint and frontend test steps to build workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0cabf1f to
7804647
Compare
joshpainter
added a commit
to joshpainter/sage
that referenced
this pull request
Feb 11, 2026
Sections 2.1 and 2.2 marked as implemented with links to PR xch-dev#739, which adds 170 frontend tests and 98 Rust tests. Updated summary matrix and strategic recommendations accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove 11 confirm flag tests duplicated by the it.each sweep - Remove mock pass-through assertions in handleFilterUnlockedCoins, handleSendTransaction, and handleSignMessageByAddress - Add missing toHaveBeenCalledWith to handleSignMessage and handleSignMessageByAddress to verify argument forwarding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
sage-keychain,sage-database,sage-config, andsageparse utilitiesFrontend (170 tests, 7 files)
Rust (98 tests, 8 files)
CI
pnpm lintandpnpm teststeps to the build workflowTest plan
pnpm test— 170 frontend tests passcargo test -p sage-keychain— 16 tests passcargo test -p sage-database— 32 tests passcargo test -p sage-config— 26 tests pass (3 pre-existing + 23 new)cargo test -p sage -- utils::parse— 24 tests pass🤖 Generated with Claude Code