Skip to content

test: coverage for Onboard and Home screens.#31

Merged
isaacsa51 merged 5 commits into
masterfrom
test/ui/onboard_main_screen_coverage
Jun 22, 2026
Merged

test: coverage for Onboard and Home screens.#31
isaacsa51 merged 5 commits into
masterfrom
test/ui/onboard_main_screen_coverage

Conversation

@isaacsa51

@isaacsa51 isaacsa51 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Description

Decoupled BudgetViewModel into 4 focused controllers with full unit test coverage, refactored the Onboarding flow onto a proper MVI architecture (state / intent / effect) with VM tests and Compose E2E tests, and redesigned the Onboarding screen into a 6-step 2-column grid that better explains Minus's features.

This branch fixes both problems:

  • BudgetViewModel is now a thin orchestrator that delegates to 4 pure state-machine controllers - each one independently testable.
  • OnboardingViewModel exposes a typed MVI contract (processIntent -> state + effects), ships with 28 unit tests, and the welcome step's "Continue" button now actually navigates to the main app.
  • A new Compose E2E suite (23 tests) covers the redesigned Onboarding screen end-to-end on the emulator, including intent dispatch, effect collection, and click handling.

Change strategy

  1. For the BudgetViewModel split: extract a pure state machine (no Android, no Hilt, no coroutines)
  2. OnboardingUiState (data class) + sealed OnboardingUiIntent + sealed OnboardingUiEffect + enum OnboardingStep, following the same pattern as the existing BudgetMviContract and MainScreenMviContract.
  3. Each E2E test instantiates OnboardingViewModel with mockk(relaxed = true) repositories and passes it to the screen. This sidesteps the @androidentrypoint requirement on the test's ComponentActivity and keeps tests focused on wiring (intent -> effect -> callback) rather than on full integration.

Implemented

  • BudgetViewModel Decouple:
    • NumpadController — numpad input state (24 unit tests)
    • EditorStateController — input validation + editor state (17 unit tests)
    • TransactionActionsController — transaction lifecycle via a TransactionHandler strategy interface (11 unit tests)
    • PeriodActionsController — period actions + isFirstLaunc

Working demo

Testing

  • Ran ./gradlew :app:testFossDebugUnitTest :app:connectedFossDebugAndroidTest :app:verifyPaparazziFossDebug -P android.testInstrumentationRunnerArguments.class=
  • Added/updated tests when applicable
  • Added screenshots or screen recordings for UI changes
image

Signed-off-by: Isaac Serrano <serranoie99@gmail.com>
Signed-off-by: Isaac Serrano <serranoie99@gmail.com>
… coverage with UTs & E2E tests

Signed-off-by: Isaac Serrano <serranoie99@gmail.com>
Signed-off-by: Isaac Serrano <serranoie99@gmail.com>
Signed-off-by: Isaac Serrano <serranoie99@gmail.com>
@isaacsa51 isaacsa51 self-assigned this Jun 22, 2026
@isaacsa51 isaacsa51 added the enhancement New feature or request label Jun 22, 2026
@isaacsa51 isaacsa51 merged commit be9b66b into master Jun 22, 2026
1 check passed
@isaacsa51 isaacsa51 deleted the test/ui/onboard_main_screen_coverage branch June 22, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant