Compose: UI testing patterns Core principle Test the smallest UI contract that proves the behavior. Prefer plain state-driven UI tests with callbacks. Add integration only when lifecycle, navigation, DI, or platform behavior is the thing under test. Test target choice | What you need to prove | Test shape | |---|---| | Text, button, loading/error branch, conditional content | Plain UI Compose test | | Callback wiring from click/input | Plain UI Compose test | | Focus navigation or keyboard behavior | Compose test with key input | | Visual layout, clipping, elevation, typography, image composi…