Change-Id: I908084076ea353fa343f10c40e1ce21944f293e1
feature/adaptive_scaffold
Miłosz Moczkowski 1 year ago
parent 3a030c82ba
commit 7f6b996085

@ -149,6 +149,27 @@ class NavigationUiTest {
composeTestRule.onNodeWithTag("adaptiveScaffold:permanentDrawer").assertDoesNotExist()
}
@Test
fun extraLargeWidth_compactHeight_showsPermanentDrawer() {
composeTestRule.setContent {
TestHarness(size = DpSize(1300.dp, 400.dp)) {
BoxWithConstraints {
NiaApp(
windowSizeClass = WindowSizeClass.calculateFromSize(
DpSize(maxWidth, maxHeight),
),
networkMonitor = networkMonitor,
userNewsResourceRepository = userNewsResourceRepository,
)
}
}
}
composeTestRule.onNodeWithTag("adaptiveScaffold:navigationRail").assertDoesNotExist()
composeTestRule.onNodeWithTag("adaptiveScaffold:navigationBar").assertDoesNotExist()
composeTestRule.onNodeWithTag("adaptiveScaffold:permanentDrawer").assertIsDisplayed()
}
@Test
fun compactWidth_mediumHeight_showsNavigationBar() {
composeTestRule.setContent {
@ -212,6 +233,27 @@ class NavigationUiTest {
composeTestRule.onNodeWithTag("adaptiveScaffold:permanentDrawer").assertDoesNotExist()
}
@Test
fun extraLargeWidth_mediumHeight_showsPermanentDrawer() {
composeTestRule.setContent {
TestHarness(size = DpSize(1300.dp, 500.dp)) {
BoxWithConstraints {
NiaApp(
windowSizeClass = WindowSizeClass.calculateFromSize(
DpSize(maxWidth, maxHeight),
),
networkMonitor = networkMonitor,
userNewsResourceRepository = userNewsResourceRepository,
)
}
}
}
composeTestRule.onNodeWithTag("adaptiveScaffold:navigationRail").assertDoesNotExist()
composeTestRule.onNodeWithTag("adaptiveScaffold:navigationBar").assertDoesNotExist()
composeTestRule.onNodeWithTag("adaptiveScaffold:permanentDrawer").assertIsDisplayed()
}
@Test
fun compactWidth_expandedHeight_showsNavigationBar() {
composeTestRule.setContent {
@ -274,4 +316,25 @@ class NavigationUiTest {
composeTestRule.onNodeWithTag("adaptiveScaffold:navigationBar").assertDoesNotExist()
composeTestRule.onNodeWithTag("adaptiveScaffold:permanentDrawer").assertDoesNotExist()
}
@Test
fun extraLargeWidth_expandedHeight_showsPermanentDrawer() {
composeTestRule.setContent {
TestHarness(size = DpSize(1300.dp, 900.dp)) {
BoxWithConstraints {
NiaApp(
windowSizeClass = WindowSizeClass.calculateFromSize(
DpSize(maxWidth, maxHeight),
),
networkMonitor = networkMonitor,
userNewsResourceRepository = userNewsResourceRepository,
)
}
}
}
composeTestRule.onNodeWithTag("adaptiveScaffold:navigationRail").assertDoesNotExist()
composeTestRule.onNodeWithTag("adaptiveScaffold:navigationBar").assertDoesNotExist()
composeTestRule.onNodeWithTag("adaptiveScaffold:permanentDrawer").assertIsDisplayed()
}
}

Loading…
Cancel
Save