From 96bd40c41a5ef68b41ae056e43bc2e3e0a4c70a2 Mon Sep 17 00:00:00 2001 From: Hamza Ahmed Khan Date: Fri, 27 Nov 2020 17:01:53 +0500 Subject: [PATCH 1/4] All clients register title translation fix --- .../core/fragment/CoreAllClientsRegisterFragment.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/opensrp-chw-core/src/main/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragment.java b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragment.java index d9baad5898..f5ec8de240 100644 --- a/opensrp-chw-core/src/main/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragment.java +++ b/opensrp-chw-core/src/main/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragment.java @@ -67,11 +67,21 @@ public void onResume() { NavigationMenu.getInstance(getActivity(), null, toolbar); } + @Override + public void initializeAdapter() { +// super.initializeAdapter(); + } + @Override protected void goToClientDetailActivity(@NonNull CommonPersonObjectClient commonPersonObjectClient) { //implement } + @Override + protected int getToolBarTitle() { + return R.string.menu_all_clients; + } + @Override public void toggleFilterSelection(View dueOnlyLayout) { if (dueOnlyLayout != null) { From 644bb81fc7f9b5b7c913126dd8962ebb69665b5d Mon Sep 17 00:00:00 2001 From: Hamza Ahmed Khan Date: Fri, 27 Nov 2020 17:11:22 +0500 Subject: [PATCH 2/4] Bumped up library version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 03b6b5a328..eb3cf14196 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=1.5.21-SNAPSHOT +VERSION_NAME=1.5.22-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Chw Core Library From 84a2f2cd94d532656cad7a847f64b0096ed59567 Mon Sep 17 00:00:00 2001 From: Hamza Ahmed Khan Date: Mon, 14 Dec 2020 11:43:12 +0500 Subject: [PATCH 3/4] Update dependencies --- opensrp-chw-core/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opensrp-chw-core/build.gradle b/opensrp-chw-core/build.gradle index b15c47fe6c..4dacbd7aa3 100644 --- a/opensrp-chw-core/build.gradle +++ b/opensrp-chw-core/build.gradle @@ -157,7 +157,7 @@ dependencies { exclude group: 'com.android.support', module: 'appcompat-v7' } - api('org.smartregister:opensrp-client-family:1.3.1-SNAPSHOT@aar') { + api('org.smartregister:opensrp-client-family:1.3.2-SNAPSHOT@aar') { transitive = true exclude group: 'org.smartregister', module: 'opensrp-client-core' exclude group: 'org.smartregister', module: 'opensrp-client-native-form' @@ -209,7 +209,7 @@ dependencies { exclude group: 'org.smartregister', module: 'opensrp-client-immunization' } - api('org.smartregister:opensrp-client-chw-malaria:1.2.18-SNAPSHOT@aar') { + api('org.smartregister:opensrp-client-chw-malaria:1.2.19-SNAPSHOT@aar') { transitive = true exclude group: 'org.smartregister', module: 'opensrp-client-core' exclude group: 'org.smartregister', module: 'opensrp-client-native-form' @@ -217,14 +217,14 @@ dependencies { exclude group: 'com.android.support', module: 'appcompat-v7' } - api('org.smartregister:opensrp-chw-family-planning:1.0.26-SNAPSHOT@aar') { + api('org.smartregister:opensrp-chw-family-planning:1.0.27-SNAPSHOT@aar') { transitive = true exclude group: 'org.smartregister', module: 'opensrp-client-core' exclude group: 'org.smartregister', module: 'opensrp-client-native-form' exclude group: 'org.smartregister', module: 'opensrp-client-configurable-views' exclude group: 'com.android.support', module: 'appcompat-v7' } - api('org.smartregister:opensrp-client-chw-referral:1.3.5-SNAPSHOT@aar') { + api('org.smartregister:opensrp-client-chw-referral:1.3.6-SNAPSHOT@aar') { transitive = true exclude group: 'org.smartregister', module: 'opensrp-client-core' exclude group: 'org.smartregister', module: 'opensrp-client-native-form' From 65b5bdd66c6dc39784d0b4e4367dd70047044c6a Mon Sep 17 00:00:00 2001 From: Hamza Ahmed Khan Date: Mon, 14 Dec 2020 11:59:44 +0500 Subject: [PATCH 4/4] Increase test coverage --- .../CoreAllClientsRegisterFragmentTest.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 opensrp-chw-core/src/test/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragmentTest.java diff --git a/opensrp-chw-core/src/test/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragmentTest.java b/opensrp-chw-core/src/test/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragmentTest.java new file mode 100644 index 0000000000..fba800cbf1 --- /dev/null +++ b/opensrp-chw-core/src/test/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragmentTest.java @@ -0,0 +1,41 @@ +package org.smartregister.chw.core.fragment; + + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.robolectric.util.ReflectionHelpers; +import org.smartregister.chw.core.BaseUnitTest; +import org.smartregister.chw.core.R; +import org.smartregister.chw.core.presenter.CoreAllClientsRegisterFragmentPresenter; + +public class CoreAllClientsRegisterFragmentTest extends BaseUnitTest { + + + @Mock + private CoreAllClientsRegisterFragmentPresenter presenter; + + private CoreAllClientsRegisterFragment fragment; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + fragment = Mockito.mock(CoreAllClientsRegisterFragment.class, Mockito.CALLS_REAL_METHODS); + ReflectionHelpers.setField(fragment, "presenter", presenter); + } + + @Test + public void presenterInitializesCorrectly() { + fragment.initializePresenter(); + Assert.assertNotNull(presenter); + } + + @Test + public void testGetToolbarTitle() { + int title = fragment.getToolBarTitle(); + Assert.assertEquals(R.string.menu_all_clients, title); + } +}