Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation fixes #112

Merged
merged 3 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=1.3.1-SNAPSHOT
VERSION_NAME=1.3.2-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Family Library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.smartregister.commonregistry.CommonPersonObjectClient;
import org.smartregister.domain.FetchStatus;
import org.smartregister.family.R;
import org.smartregister.family.activity.BaseFamilyProfileActivity;
import org.smartregister.family.contract.FamilyProfileContract;
import org.smartregister.family.domain.FamilyEventClient;
import org.smartregister.family.interactor.FamilyProfileInteractor;
Expand Down Expand Up @@ -119,11 +120,11 @@ public void refreshProfileTopSection(CommonPersonObjectClient client) {
if (Utils.getBooleanProperty(Constants.Properties.FAMILY_HEAD_FIRSTNAME_ENABLED)) {

String familyHeadFirstName = Utils.getValue(client.getColumnmaps(), Constants.KEY.FAMILY_HEAD_NAME, true);
famName = getView().getApplicationContext().getString(R.string.family_profile_title_with_firstname, familyHeadFirstName, firstName);
famName = ((BaseFamilyProfileActivity) getView()).getString(R.string.family_profile_title_with_firstname, familyHeadFirstName, firstName);

} else {

famName = getView().getApplicationContext().getString(R.string.family_profile_title, firstName);
famName = ((BaseFamilyProfileActivity) getView()).getString(R.string.family_profile_title, firstName);
}

getView().setProfileName(famName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.smartregister.domain.FetchStatus;
import org.smartregister.family.BaseUnitTest;
import org.smartregister.family.R;
import org.smartregister.family.activity.BaseFamilyProfileActivity;
import org.smartregister.family.contract.FamilyProfileContract;
import org.smartregister.family.domain.FamilyEventClient;

Expand All @@ -36,6 +37,9 @@ public class BaseFamilyProfilePresenterTest extends BaseUnitTest {
@Mock
private FamilyProfileContract.Interactor interactor;

@Mock
private BaseFamilyProfileActivity familyProfileActivity;

private Context context = RuntimeEnvironment.application;

private String familyBaseEntityId = "familyBaseEntityId";
Expand Down Expand Up @@ -69,13 +73,14 @@ public void testRefreshProfileView() {

@Test
public void testRefreshProfileTopSection() {
BaseFamilyProfilePresenter mockPresenter = Mockito.spy(presenter);
CommonPersonObjectClient client = Mockito.mock(CommonPersonObjectClient.class);
Mockito.doReturn("12345").when(client).getCaseId();
Mockito.doReturn(context).when(view).getApplicationContext();
Mockito.doReturn(familyProfileActivity).when(mockPresenter).getView();

presenter.refreshProfileTopSection(client);
mockPresenter.refreshProfileTopSection(client);

Mockito.verify(view).setProfileImage(client.getCaseId());
Mockito.verify(familyProfileActivity).setProfileImage(client.getCaseId());
}

@Test
Expand Down