summaryrefslogtreecommitdiffhomepage
path: root/android/app/src
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-09-25 10:38:57 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-09-25 10:38:57 +0200
commit3e9857bdb6b028b2a3be4f722060486110d8094e (patch)
tree1d7d02fe572fdfd6ed548b8b4728d2345d8da551 /android/app/src
parent4e0bf7ffdc30547b08bfd1a0765e7be78439cc0c (diff)
parent11a84c93cd222f736fc4188f88c11945b6c92de3 (diff)
downloadmullvadvpn-3e9857bdb6b028b2a3be4f722060486110d8094e.tar.xz
mullvadvpn-3e9857bdb6b028b2a3be4f722060486110d8094e.zip
Merge branch 'fix-android-screen-tests-not-asserting'
Diffstat (limited to 'android/app/src')
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreenTest.kt6
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreenTest.kt2
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreenTest.kt4
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreenTest.kt4
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/LocationBottomSheet.kt2
5 files changed, 10 insertions, 8 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreenTest.kt
index 55922ff008..7225143ef9 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreenTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessListScreenTest.kt
@@ -48,7 +48,7 @@ class ApiAccessListScreenTest {
)
// Assert
- onNodeWithText("Current: ${currentApiAccessMethod.name}")
+ onNodeWithText("Current: ${currentApiAccessMethod.name}").assertExists()
}
@Test
@@ -61,8 +61,8 @@ class ApiAccessListScreenTest {
)
// Assert
- onNodeWithText(apiAccessMethod.name.value)
- onNodeWithText("On")
+ onNodeWithText(apiAccessMethod.name.value).assertExists()
+ onNodeWithText("On").assertExists()
}
@Test
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreenTest.kt
index 8c3975bed5..15ee5a841d 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreenTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ApiAccessMethodDetailsScreenTest.kt
@@ -89,7 +89,7 @@ class ApiAccessMethodDetailsScreenTest {
onNodeWithText("Enable method").performClick()
// Assert
- onNodeWithText("At least one method needs to be enabled")
+ onNodeWithText("At least one method needs to be enabled").assertExists()
verify(exactly = 0) { onEnableClicked(any()) }
}
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreenTest.kt
index 971a7f5459..a2cd982149 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreenTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreenTest.kt
@@ -84,7 +84,7 @@ class EditCustomListScreenTest {
)
// Assert
- onNodeWithText(customList.name.value)
+ onNodeWithText(customList.name.value).assertExists()
}
@Test
@@ -102,7 +102,7 @@ class EditCustomListScreenTest {
)
// Assert
- onNodeWithText(LOCATIONS_TEXT.format(customList.locations.size))
+ onNodeWithText(LOCATIONS_TEXT.format(customList.locations.size)).assertExists()
}
@Test
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreenTest.kt
index 5fdf9c047c..09a0fa9be3 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreenTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationScreenTest.kt
@@ -293,7 +293,7 @@ class SelectLocationScreenTest {
onNodeWithText(customList.relay.name).performLongClick()
// Assert
- onNodeWithTag(SELECT_LOCATION_CUSTOM_LIST_BOTTOM_SHEET_TEST_TAG)
+ onNodeWithTag(SELECT_LOCATION_CUSTOM_LIST_BOTTOM_SHEET_TEST_TAG).assertExists()
}
@Test
@@ -337,7 +337,7 @@ class SelectLocationScreenTest {
onNodeWithText(relayItem.relay.name).performLongClick()
// Assert
- onNodeWithTag(SELECT_LOCATION_LOCATION_BOTTOM_SHEET_TEST_TAG)
+ onNodeWithTag(SELECT_LOCATION_LOCATION_BOTTOM_SHEET_TEST_TAG).assertExists()
}
companion object {
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/LocationBottomSheet.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/LocationBottomSheet.kt
index 2cc07cfa86..77ced712a4 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/LocationBottomSheet.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/LocationBottomSheet.kt
@@ -37,6 +37,7 @@ import net.mullvad.mullvadvpn.compose.util.showSnackbarImmediately
import net.mullvad.mullvadvpn.lib.model.CustomListId
import net.mullvad.mullvadvpn.lib.model.CustomListName
import net.mullvad.mullvadvpn.lib.model.RelayItem
+import net.mullvad.mullvadvpn.lib.ui.tag.SELECT_LOCATION_CUSTOM_LIST_BOTTOM_SHEET_TEST_TAG
import net.mullvad.mullvadvpn.lib.ui.tag.SELECT_LOCATION_LOCATION_BOTTOM_SHEET_TEST_TAG
import net.mullvad.mullvadvpn.relaylist.canAddLocation
@@ -183,6 +184,7 @@ private fun EditCustomListBottomSheet(
onBackgroundColor = onBackgroundColor,
sheetState = sheetState,
onDismissRequest = { closeBottomSheet(false) },
+ modifier = Modifier.testTag(SELECT_LOCATION_CUSTOM_LIST_BOTTOM_SHEET_TEST_TAG),
) {
HeaderCell(text = customList.name, background = backgroundColor)
HorizontalDivider(color = onBackgroundColor)