-
Notifications
You must be signed in to change notification settings - Fork 21
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
Issue fix sync pr1855 #2111
base: master
Are you sure you want to change the base?
Issue fix sync pr1855 #2111
Conversation
org.smartregister.util.Utils.getAllSharedPreferences().saveLastSyncDate(serverVersion); | ||
|
||
// flag all contentious events as unsynced | ||
EventDao.markEventsForReUpload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekigamba this is the Protected method writing a unit test might not be applicable for it
Kindly update the issue title |
|
|
||
@Test | ||
public void testHandleSync() { | ||
chwSyncIntentService.handleSync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junaidwarsivd I am not sure if testHandleSync() method is complete
@Test | ||
public void testGoToChildProfile() { | ||
AllClientsUtils.goToChildProfile(mockActivity, mockPatient, mockBundle); | ||
verify(mockActivity).startActivity(ArgumentMatchers.any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Kindly update this test to match the expected activity class here
- Check that the intent has the correct extras as expected
|
||
verify(database).execSQL("ALTER TABLE ec_family ADD COLUMN entity_type VARCHAR; UPDATE ec_family SET entity_type = 'ec_family' WHERE id is not null;"); | ||
|
||
verify(database).execSQL("ALTER TABLE ec_family ADD COLUMN entity_type VARCHAR; UPDATE ec_family SET entity_type = 'ec_family' WHERE id is not null;"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Kindly remove the duplicated verification here
- Test/assert that the fields are added to the FTS table
verify(mockBottomNavigationView).setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); | ||
verify(mockBottomNavigationView).inflateMenu(R.menu.bottom_nav_menu); | ||
verify(mockBottomNavigationHelper).disableShiftMode(mockBottomNavigationView); | ||
verify(mockBottomNavigationView).setOnNavigationItemSelectedListener(mockListener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we verify if the QR, job aids and reports items are removed if the flavor does not have them
// fetch the last downloaded serverVersion before any unsyced data | ||
Long serverVersion = EventDao.getMinimumVerifiedServerVersion(); | ||
if (serverVersion != null) | ||
org.smartregister.util.Utils.getAllSharedPreferences().saveLastSyncDate(serverVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this try to sync already synced events and clients? I just want to understand this
Kindly rename the PR so that it's easy to search |
added the missng code from the Pr 1855 in ChwSyncIntentService