diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-09-25 10:38:57 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-09-25 10:38:57 +0200 |
| commit | 3e9857bdb6b028b2a3be4f722060486110d8094e (patch) | |
| tree | 1d7d02fe572fdfd6ed548b8b4728d2345d8da551 /android/app/src | |
| parent | 4e0bf7ffdc30547b08bfd1a0765e7be78439cc0c (diff) | |
| parent | 11a84c93cd222f736fc4188f88c11945b6c92de3 (diff) | |
| download | mullvadvpn-3e9857bdb6b028b2a3be4f722060486110d8094e.tar.xz mullvadvpn-3e9857bdb6b028b2a3be4f722060486110d8094e.zip | |
Merge branch 'fix-android-screen-tests-not-asserting'
Diffstat (limited to 'android/app/src')
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) |
