summaryrefslogtreecommitdiffhomepage
path: root/android/app/src/androidTest/kotlin
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2024-06-24 11:07:48 +0200
committerDavid Göransson <david.goransson@mullvad.net>2024-07-04 12:06:19 +0200
commit76f57d2a131aa998fadaa7b9a80f7435bddec8b9 (patch)
treed7af39cfc3befda56bb059fe3aea82a33f299489 /android/app/src/androidTest/kotlin
parent73bba2cfb78b789241db09ff5e39f638ecfad5ac (diff)
downloadmullvadvpn-76f57d2a131aa998fadaa7b9a80f7435bddec8b9.tar.xz
mullvadvpn-76f57d2a131aa998fadaa7b9a80f7435bddec8b9.zip
Use NavArgs & SavedStateHandle
Diffstat (limited to 'android/app/src/androidTest/kotlin')
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialogTest.kt9
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialogTest.kt4
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/EditCustomListScreenTest.kt4
3 files changed, 7 insertions, 10 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialogTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialogTest.kt
index ee347c246a..184cd7defe 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialogTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialogTest.kt
@@ -32,8 +32,7 @@ class DeleteCustomListConfirmationDialogTest {
val name = CustomListName.fromString("List should be deleted")
setContentWithTheme {
DeleteCustomListConfirmationDialog(
- name = name,
- state = DeleteCustomListUiState(null)
+ state = DeleteCustomListUiState(name = name, deleteError = null),
)
}
@@ -49,8 +48,7 @@ class DeleteCustomListConfirmationDialogTest {
val mockedOnDelete: () -> Unit = mockk(relaxed = true)
setContentWithTheme {
DeleteCustomListConfirmationDialog(
- name = name,
- state = DeleteCustomListUiState(null),
+ state = DeleteCustomListUiState(name = name, deleteError = null),
onDelete = mockedOnDelete
)
}
@@ -70,8 +68,7 @@ class DeleteCustomListConfirmationDialogTest {
val mockedOnBack: () -> Unit = mockk(relaxed = true)
setContentWithTheme {
DeleteCustomListConfirmationDialog(
- name = name,
- state = DeleteCustomListUiState(null),
+ state = DeleteCustomListUiState(name = name, deleteError = null),
onBack = mockedOnBack
)
}
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialogTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialogTest.kt
index 3128bbc508..6bca03db69 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialogTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/EditCustomListNameDialogTest.kt
@@ -126,7 +126,7 @@ class EditCustomListNameDialogTest {
fun whenInputIsChangedShouldCallOnInputChanged() =
composeExtension.use {
// Arrange
- val mockedOnInputChanged: () -> Unit = mockk(relaxed = true)
+ val mockedOnInputChanged: (String) -> Unit = mockk(relaxed = true)
val inputText = "NEW NAME"
val state = EditCustomListNameUiState()
setContentWithTheme {
@@ -137,7 +137,7 @@ class EditCustomListNameDialogTest {
onNodeWithTag(EDIT_CUSTOM_LIST_DIALOG_INPUT_TEST_TAG).performTextInput(inputText)
// Assert
- verify { mockedOnInputChanged.invoke() }
+ verify { mockedOnInputChanged.invoke(inputText) }
}
companion object {
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 5e57309777..2bc53013ca 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
@@ -93,7 +93,7 @@ class EditCustomListScreenTest {
fun whenClickingOnDeleteDropdownShouldCallOnDeleteList() =
composeExtension.use {
// Arrange
- val mockedOnDelete: (CustomListName) -> Unit = mockk(relaxed = true)
+ val mockedOnDelete: (CustomListId, CustomListName) -> Unit = mockk(relaxed = true)
val customList = DUMMY_CUSTOM_LISTS[0]
setContentWithTheme {
EditCustomListScreen(
@@ -112,7 +112,7 @@ class EditCustomListScreenTest {
onNodeWithTag(DELETE_DROPDOWN_MENU_ITEM_TEST_TAG).performClick()
// Assert
- verify { mockedOnDelete(customList.name) }
+ verify { mockedOnDelete(customList.id, customList.name) }
}
@Test