fix(tests): repair unit tests broken by the new-ui v2 merge - #1212
Merged
Conversation
The v2 tab-bar UI change (#1209) landed with three stale unit-test expectations that break `./gradlew test`: - BalanceViewModelTest: BalanceViewModel gained chatCoordinator + feedCoordinator constructor params; pass relaxed mocks. - BuildNavGraphForLaunchTest: buildNavGraphForLaunch gained an isNewUi param; pass isNewUi = false (the existing assertions cover the v1 routing). - BuildNavGraphForLaunchTest: AuthState.Unknown is now intentionally grouped with Authenticating and returns null (wait on Loading) rather than routing to OnboardingFlow; update the test to assert that documented behavior.
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.
Problem
./gradlew test(the CIRun Flipcash Testsjob) is red oncode/cash— the v2 tab-bar UI merge (#1209) changed three production signatures/behaviors but left the unit tests asserting the old ones. Because the compile of those test sources fails, CI goes red for every open PR based oncode/cash, not just the change that happens to be under review.Fixes
BalanceViewModelTest—BalanceViewModelgainedchatCoordinator+feedCoordinatorconstructor params; the test now passes relaxed mocks for them.BuildNavGraphForLaunchTest—buildNavGraphForLaunchgained anisNewUiparam; the test helper passesisNewUi = false(its assertions cover v1 routing).BuildNavGraphForLaunchTest—AuthState.Unknownis now intentionally grouped withAuthenticatingand returnsnull(stay on the Loading screen until auth resolves), per the explanatory comment inMainRoot. The stale test assertedUnknown → OnboardingFlow; it now asserts the documented wait-on-Loading behavior, mirroring the existingAuthenticatingtest.Verification
./gradlew testDebugUnitTest --continueis fully green (:apps:flipcash:appand:apps:flipcash:features:balancetest tasks force-reran and pass). No production code changed — tests only.Merging this unblocks CI on the other open PRs based on
code/cash.