wnb-compose-ui-testlisted
Install: claude install-skill wenubey/claude-android-skills
# Jetpack Compose UI test — canonical skeleton
Every screen-level Compose test in this project has the same shape. Same rule, same dispatcher trick, same factory pattern, same finder discipline. Do not invent variants.
Pairs with `[[wnb-viewmodel-udf]]` and `[[wnb-viewmodel-test]]` — a screen's ViewModel unit test verifies the state machine; this UI test verifies the state renders correctly and one critical interaction works.
## Non-negotiables
1. **`@get:Rule val composeTestRule = createComposeRule()`** — one rule per test class. Never `createAndroidComposeRule<Activity>()` unless you specifically need the host Activity (rare).
2. **Inline `DispatcherProvider` with `Dispatchers.Unconfined`** for all three (`main`, `io`, `default`). This makes VM state updates propagate to the tree synchronously — no missed emissions, no `advanceUntilIdle`. Only exception: tests that specifically need to inspect intermediate loading state can use a `StandardTestDispatcher` + `MainDispatcherRule` combo; the default is Unconfined.
3. **`renderScreen(...)` factory** at the top of every test class. Constructs the VM with defaultable fake repositories, calls `composeTestRule.setContent { XxxScreen(viewModel = vm, …) }`, and **returns the VM** so tests can assert against `vm.state.value` directly.
4. **Semantics-first finders**, in this preference order:
- `onNodeWithTag("submitButton")` — best for interactive elements (add `Modifier.testTag(...)` in the composable).
- `onNodeWithContentD