From 5fa674a1f8738ebb80397ffd5be3d569f6b81428 Mon Sep 17 00:00:00 2001 From: Darkeye14 Date: Thu, 7 Nov 2024 16:03:30 +0530 Subject: [PATCH 1/2] . --- .../com/mifos/feature/groups/GroupListScreenTest.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt b/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt index 5d8e92c1a0..f217997a7f 100644 --- a/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt +++ b/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt @@ -124,7 +124,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - onSyncClick = {}, + //onSyncClick = {}, resetSelectionMode = {}, ) } @@ -164,7 +164,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - onSyncClick = {}, + // onSyncClick = {}, resetSelectionMode = {}, ) } @@ -201,7 +201,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - onSyncClick = {}, + // onSyncClick = {}, resetSelectionMode = {}, ) } @@ -253,7 +253,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - onSyncClick = {}, + // onSyncClick = {}, resetSelectionMode = {}, ) } @@ -312,7 +312,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - onSyncClick = {}, + // onSyncClick = {}, resetSelectionMode = {}, ) } @@ -380,7 +380,7 @@ class GroupListScreenTest { } }, onAddGroupClick = {}, - onSyncClick = {}, + // onSyncClick = {}, resetSelectionMode = { selectedItems.clear() }, From b5c638e31e0ab0c4310a8b77f42240a4c835fb8f Mon Sep 17 00:00:00 2001 From: Darkeye14 Date: Fri, 8 Nov 2024 11:38:48 +0530 Subject: [PATCH 2/2] App crash during activation resolved using try and catch block --- .../com/mifos/feature/activate/ActivateScreen.kt | 11 ++++++++--- .../com/mifos/feature/groups/GroupListScreenTest.kt | 12 ++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt b/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt index 8ebcbfb554..2736ca32b5 100644 --- a/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt +++ b/feature/activate/src/main/java/com/mifos/feature/activate/ActivateScreen.kt @@ -63,19 +63,24 @@ fun ActivateScreen( ActivateScreen( state = state, onActivate = { + val clientIdAsInt: Int = try { + id + } catch (e: Exception) { + 0 + } when (activateType) { Constants.ACTIVATE_CLIENT -> viewModel.activateClient( - clientId = id, + clientId = clientIdAsInt, clientPayload = it ) Constants.ACTIVATE_CENTER -> viewModel.activateCenter( - centerId = id, + centerId = clientIdAsInt, centerPayload = it ) Constants.ACTIVATE_GROUP -> viewModel.activateGroup( - groupId = id, + groupId = clientIdAsInt, groupPayload = it ) diff --git a/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt b/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt index f217997a7f..5d8e92c1a0 100644 --- a/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt +++ b/feature/groups/src/androidTest/java/com/mifos/feature/groups/GroupListScreenTest.kt @@ -124,7 +124,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - //onSyncClick = {}, + onSyncClick = {}, resetSelectionMode = {}, ) } @@ -164,7 +164,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - // onSyncClick = {}, + onSyncClick = {}, resetSelectionMode = {}, ) } @@ -201,7 +201,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - // onSyncClick = {}, + onSyncClick = {}, resetSelectionMode = {}, ) } @@ -253,7 +253,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - // onSyncClick = {}, + onSyncClick = {}, resetSelectionMode = {}, ) } @@ -312,7 +312,7 @@ class GroupListScreenTest { onGroupClick = {}, onSelectItem = {}, onAddGroupClick = {}, - // onSyncClick = {}, + onSyncClick = {}, resetSelectionMode = {}, ) } @@ -380,7 +380,7 @@ class GroupListScreenTest { } }, onAddGroupClick = {}, - // onSyncClick = {}, + onSyncClick = {}, resetSelectionMode = { selectedItems.clear() },