Skip to content

test: full ViewModel state coverage (328 -> 388 tests) - #7

Merged
jdluu merged 1 commit into
mainfrom
refactor/ui-hygiene
Aug 26, 2026
Merged

test: full ViewModel state coverage (328 -> 388 tests)#7
jdluu merged 1 commit into
mainfrom
refactor/ui-hygiene

Conversation

@jdluu

@jdluu jdluu commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 6 of the refactor plan.

  • Turbine state-emission tests for all six previously untested ViewModels: Dashboard, History, Planner, PRList, Settings, WorkoutDetail
  • Covers init load, refresh, error mapping, network states, and key user actions per screen
  • Deterministic coroutine testing via a runVmTest helper (Main bound to the test scheduler); stress-verified over repeated clean-suite runs
  • Shared scripted fakes; per-test DataStore reset prevents cross-test leakage

Test Plan

  • All pre-existing tests pass unchanged
  • 60 new ViewModel tests = 388 total, 0 failures across 3 consecutive clean runs
  • ./gradlew lintDebug assembleDebug exit 0
  • CI green on this PR

- Add Turbine-based state-emission tests for Dashboard, History,
  Planner, PRList, Settings and WorkoutDetail view models (388 total
  tests, up from 328)
- Shared scripted fakes in fakes/VmTestFakes.kt; per-test preference
  reset isolates the process-wide DataStore between Robolectric tests
- runVmTest helper binds Main to the test scheduler so init delays
  resolve deterministically without real-time polling flakiness
@jdluu
jdluu merged commit 5810bf9 into main Aug 26, 2026
3 checks passed
@jdluu
jdluu deleted the refactor/ui-hygiene branch August 26, 2026 06:16
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.

1 participant