Sadly, `AndroidComposeTestRule` is not of much use...
# compose
d
Sadly,
AndroidComposeTestRule
is not of much use for me, the implementation basically has two issues: 1. It doesn't work with Fragments, since
setContent
is directly called on the
Activity
of an
ActivityScenario
, ignoring fragment semantics completely. 2. It's impossible to test the UI with the viewmodel in integration, as one basically has to manually connect the `ViewModel`s state flow to a separate
setContent
call on the test rule, ignoring the beef of the viewmodel / view integration altogether. I wish the test architecure in compose would have been written around the fact to have an injectable
Recomposer
for testing purposes.
After looking into my possibilities I created a feature request for a more friendly testing API: https://issuetracker.google.com/issues/199631334