fix(test): make StackNavHostTest survive routes that use hiltViewModel#30
Merged
Conversation
The Android Studio template robot was still shipping as the app icon
and as the splash mark. Ports the layered-squares glyph the login
hero uses (LoginScreen.StackLogoGlyph) into the launcher + splash
slots so the app's branding is consistent from the launcher tap
through to the first Compose frame.
* ic_launcher_foreground: brand glyph sized for the adaptive-icon
safe zone (central 66dp of a 108dp viewport) so the corners
survive round / squircle launcher masks.
* ic_launcher_background: solid SurfaceBase (#0B0B12) plate that
matches the window background, so the splash-to-content
transition doesn't flash a different color.
* ic_launcher_monochrome: single-tint variant for Android 13+
themed icons (the previous adaptive-icon XML pointed monochrome
at the colored foreground, which the platform can't recolor
cleanly).
* ic_brand_splash: standalone splash glyph that fills the full
108dp viewport. The launcher foreground has to keep its content
inside the safe zone and would render visibly small in the
SplashScreen API icon area (no mask is applied there); this
drawable expands the same three squares so the splash reads as
the Stack mark instead of a tiny inset.
* themes.xml: splash theme now points at ic_brand_splash.
Legacy mipmap-{m,h,xh,xxh,xxxh}dpi PNGs are untouched. They only
ship to API 24-25 devices that can't load the adaptive-icon XML
(min SDK is 24, so the fallback is required); generating new PNGs
from the vector needs a build-time tool that isn't wired in yet.
The smoke suite started failing the moment real screens replaced the
nav placeholders, because the default createComposeRule() launches a
plain ComponentActivity that Hilt cannot wire ("Given component
holder class androidx.activity.ComponentActivity does not implement
interface dagger.hilt.internal.GeneratedComponent...").
Adds a bare `@AndroidEntryPoint HiltTestActivity` in `src/debug/` so
the debug APK ships it (the instrumentation runner resolves
activities through the target APK's PackageManager, so the class
cannot live in `src/androidTest/` alone). The test now wires
HiltAndroidRule + createAndroidComposeRule<HiltTestActivity>() via a
RuleChain so Hilt injects before the activity launches; navigation
uses defaultPath to support Wallet's optional `?tab={tab}` query
arg without re-asserting the bare path.
All 26 instrumented tests pass on device after this change.
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
every_static_route_is_reachableandparametric_routes_resolve_with_argumentssince the placeholders for Login / News / Assistant became real screens callinghiltViewModel(). The defaultcreateComposeRule()mounts a plainComponentActivitythat Hilt cannot wire, surfacing"Given component holder class androidx.activity.ComponentActivity does not implement interface dagger.hilt.internal.GeneratedComponent...".@AndroidEntryPoint HiltTestActivityinsrc/debug/(variant-scoped: the release APK never ships it) so the debug build's PackageManager can resolve the activity the test launches. Keeping the class insrc/androidTest/would have produced "Unable to resolve activity" because instrumentation runs against the target APK, not the test APK.StackNavHostTestto useHiltAndroidRule+createAndroidComposeRule<HiltTestActivity>()via aRuleChainso Hilt injects before the activity launches. The static-route check now navigates viaroute.defaultPathso Wallet's parametric?tab={tab}route still resolves cleanly.Test plan