summaryrefslogtreecommitdiffhomepage
path: root/android/app/src/androidTest
diff options
context:
space:
mode:
authorMaryamShaghaghi <122574719+MaryamShaghaghi@users.noreply.github.com>2023-11-27 14:38:05 +0100
committerMaryamShaghaghi <122574719+MaryamShaghaghi@users.noreply.github.com>2023-12-04 11:34:15 +0100
commit62fa2db4f196adfda37b2cb0dc01492c07849e9a (patch)
treeab768099b0fe8c7288b0d73624152aa1832a3f1c /android/app/src/androidTest
parent1e64dcdbd9d82173c65a4d4b49f72f80f7de8269 (diff)
downloadmullvadvpn-62fa2db4f196adfda37b2cb0dc01492c07849e9a.tar.xz
mullvadvpn-62fa2db4f196adfda37b2cb0dc01492c07849e9a.zip
Add select location screen and viewmodel tests
Co-Authored-By: Boban Sijuk <49131853+boki91@users.noreply.github.com>
Diffstat (limited to 'android/app/src/androidTest')
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt29
1 files changed, 24 insertions, 5 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt
index 3b5da50d33..7e66bc24d9 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreenTest.kt
@@ -56,7 +56,10 @@ class SelectLocationScreenTest {
uiState =
SelectLocationUiState.ShowData(
countries = DUMMY_RELAY_COUNTRIES,
- selectedRelay = null
+ selectedRelay = null,
+ selectedOwnership = null,
+ selectedProvidersCount = 0,
+ searchTerm = ""
),
uiCloseAction = MutableSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow()
@@ -93,7 +96,10 @@ class SelectLocationScreenTest {
uiState =
SelectLocationUiState.ShowData(
countries = updatedDummyList,
- selectedRelay = updatedDummyList[0].cities[0].relays[0]
+ selectedRelay = updatedDummyList[0].cities[0].relays[0],
+ selectedOwnership = null,
+ selectedProvidersCount = 0,
+ searchTerm = ""
),
uiCloseAction = MutableSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow()
@@ -118,7 +124,13 @@ class SelectLocationScreenTest {
composeTestRule.setContentWithTheme {
SelectLocationScreen(
uiState =
- SelectLocationUiState.ShowData(countries = emptyList(), selectedRelay = null),
+ SelectLocationUiState.ShowData(
+ countries = emptyList(),
+ selectedRelay = null,
+ selectedOwnership = null,
+ selectedProvidersCount = 0,
+ searchTerm = ""
+ ),
uiCloseAction = MutableSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow(),
onSearchTermInput = mockedSearchTermInput
@@ -140,7 +152,14 @@ class SelectLocationScreenTest {
val mockSearchString = "SEARCH"
composeTestRule.setContentWithTheme {
SelectLocationScreen(
- uiState = SelectLocationUiState.NoSearchResultFound(searchTerm = mockSearchString),
+ uiState =
+ SelectLocationUiState.ShowData(
+ countries = emptyList(),
+ selectedRelay = null,
+ selectedOwnership = null,
+ selectedProvidersCount = 0,
+ searchTerm = mockSearchString
+ ),
uiCloseAction = MutableSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow(),
onSearchTermInput = mockedSearchTermInput
@@ -187,7 +206,7 @@ class SelectLocationScreenTest {
private val DUMMY_RELAY_COUNTRIES =
RelayList(
arrayListOf(DUMMY_RELAY_COUNTRY_1, DUMMY_RELAY_COUNTRY_2),
- DUMMY_WIREGUARD_ENDPOINT_DATA
+ DUMMY_WIREGUARD_ENDPOINT_DATA,
)
.toRelayCountries(ownership = Constraint.Any(), providers = Constraint.Any())
}