-
Couldn't load subscription status.
- Fork 30
Open
Description
Description:
When running Kotest BehaviorSpec tests in Android Studio, the test tree in the Run/Test Results panel does not correctly nest When conditions under their Given scopes.
Instead, all When conditions appear flat, and Then conditions are not shown as a hierarchical tree.
Example Code:
class MyFavoriteViewModelKotestTest : BehaviorSpec({
Given("checks TV state before posting to watchlist") {
When("the TV show is not in watchlist") {
Then("it should call postWatchlist and emit success") {
// test
}
}
When("the TV show is already in watchlist") {
Then("it should emit snackBarAlready with title") {
// test
}
}
}
})Expected Behavior:
The test results should appear as a proper hierarchy:
Given: checks TV state before posting to watchlist
When: the TV show is not in watchlist
Then: it should call postWatchlist and emit success
When: the TV show is already in watchlist
Then: it should emit snackBarAlready with titleActual Behavior:
Android Studio shows:
Given: checks TV state before posting to watchlist
When: the TV show is not in watchlist
Then: it should call postWatchlist and emit success
Then: it should emit snackBarAlready with titleThe second When is missing, and its Then is wrongly grouped under the first When.
Environment:
- Kotest: 6.0.0
- Kotest Android Studio Plugin: 6.0.101-2025.1
- Android Studio: Android Studio Narwhal Feature Drop | 2025.1.2 AI-251.26094.121.2512.13840223 July 26, 2025
- OS: Windows 10
Screenshots
Screenshots from my actual code on android studio
Metadata
Metadata
Assignees
Labels
No labels