Skip to content

Commit

Permalink
fix: set MapScreenTest content directly to MapScreen instead of Perio…
Browse files Browse the repository at this point in the history
…dPalsAppTheme
  • Loading branch information
francelu committed Nov 1, 2024
1 parent 96ed52f commit c4ac7aa
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.android.periodpals.ui.map

// UI test for MapViewContainer.kt

import androidx.compose.material3.MaterialTheme
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.navigation.compose.rememberNavController
Expand All @@ -17,11 +18,9 @@ class MapScreenTest {
@Test
fun testMapScreenWithPermissionGranted() {
composeTestRule.setContent {
PeriodPalsAppTheme {
MapScreen(
locationPermissionGranted = true,
navigationActions = NavigationActions(rememberNavController()))
}
}
// Verify that the map is displayed when permission is granted
composeTestRule.onNodeWithTag("MapView").assertExists()
Expand All @@ -30,11 +29,9 @@ class MapScreenTest {
@Test
fun testMapScreenWithoutPermission() {
composeTestRule.setContent {
PeriodPalsAppTheme {
MapScreen(
locationPermissionGranted = false,
navigationActions = NavigationActions(rememberNavController()))
}
MapScreen(
locationPermissionGranted = false,
navigationActions = NavigationActions(rememberNavController()))
}
// Verify that the map is still displayed even if permission is not granted
composeTestRule.onNodeWithTag("MapView").assertExists()
Expand Down

0 comments on commit c4ac7aa

Please sign in to comment.