refactor: enforce UI-driven interaction hierarchy in integration tests#769
Conversation
- Remove direct InvestPageViewModel construction (new) from 3 tests; use UI navigation (OpenProjectDetail → OpenInvestPage) instead - Add DIRECT SDK CALL / DIAGNOSTIC SDK CALL comments to justified bypass locations in 4 test files - Update TESTING_GUIDELINES.md with interaction hierarchy rules - Add missing markdown docs for 4 tests
Detailed SummaryProblemSeveral integration tests were bypassing the UI layer by constructing ViewModels directly with What Changed1. Eliminated direct ViewModel construction (3 files)These tests previously resolved
All now use the UI navigation path: 2. Documented justified SDK bypass locations (4 files)Added standardized comments explaining why direct SDK calls are necessary:
3. Updated TESTING_GUIDELINES.md
4. Created 4 missing markdown docs
VerificationAll 19 integration tests were run individually and pass:
|
|
|
||
| ## Purpose | ||
|
|
||
| Fast smoke test verifying recent fixes to the InvestPageViewModel and InvestModalsView. Tests that error bindings, immediate UX feedback, tab-driven labels, and defensive error labeling all work correctly without needing a funded wallet or testnet faucet. |
There was a problem hiding this comment.
@DavidGershony I wonder do we need this test? it feels more like a unit test then integration what do you think?
The elements being tests are probably already covered in a full integration test.
There was a problem hiding this comment.
We still had the issue that nothing worked at some point.
Summary
new InvestPageViewModel(...)construction from 3 test files (OneClickInvestLightningTest,OneClickInvestOnChainTest,InvestModalsViewFixesTest) — tests now navigate through the UI (Find Projects → OpenProjectDetail → OpenInvestPage) to obtain the ViewModel// DIRECT SDK CALL:and// DIAGNOSTIC SDK CALL:comments to 4 test files where SDK bypass is justified, documenting why no ViewModel exposes the needed dataTESTING_GUIDELINES.mdwith interaction hierarchy rules (UI clicks > VM method calls > direct SDK calls) and expanded the test inventory from 6 to 14 entriesOneClickInvestLightningTest,OneClickInvestOnChainTest,InvestModalsViewFixesTest, andFindProjectsPanelTestsAll 19 integration tests pass individually.