-
Notifications
You must be signed in to change notification settings - Fork 332
Open
Description
Actual
The emulator remains with the display size modified. Wiping the device is required to restore the original state.
Full test code (if helpful)
@OptIn(ExperimentalTestApi::class)
@RunWith(AndroidJUnit4::class)
class AppNavigationTests {
@get:Rule(order = 0)
val koinRule = KoinTestRule(
modules = listOf(
module {
singleOf(::FakeConferenceRepository) bind ConferenceRepository::class
viewModelOf(::MainViewModel)
}
)
)
@get:Rule(order = 1)
val composeRule = createAndroidComposeRule<ComponentActivity>()
@get:Rule(order = 2)
var displaySizeRule: DisplaySizeRule = DisplaySizeRule()
@Test
fun should_display_bottom_bar_when_compact() {
onDevice().setDisplaySize(
widthSizeClass = WidthSizeClass.COMPACT,
heightSizeClass = HeightSizeClass.MEDIUM
)
composeRule.setContent {
Red30TechApp()
}
composeRule
.onNodeWithTag("ui:bottomBar").assertIsDisplayed()
}
@Test
fun should_display_rail_when_medium() {
onDevice().setDisplaySize(
widthSizeClass = WidthSizeClass.MEDIUM,
heightSizeClass = HeightSizeClass.MEDIUM
)
composeRule.setContent {
Red30TechApp()
}
composeRule
.onNodeWithTag("ui:navigationRail").assertIsDisplayed()
}
}
Expected
The emulator is restored to its original state.
Metadata
Metadata
Assignees
Labels
No labels