opensrp / fhircore

FHIR Core / OpenSRP 2 is a Kotlin application for delivering offline-capable, mobile-first healthcare project implementations from local community to national and international scale using FHIR and WHO Smart Guidelines on Android.
https://smartregister.org
Apache License 2.0
50 stars 39 forks source link

Write Unit Tests on Related Entity Location sync strategy enchancements #3144

Closed brandy-kay closed 2 months ago

brandy-kay commented 3 months ago

…urce identifierIMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #3105

Engineer Checklist

Code Reviewer Checklist

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 30.1%. Comparing base (ac82739) to head (90209bf). Report is 30 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/opensrp/fhircore/pull/3144/graphs/tree.svg?width=650&height=150&src=pr&token=IJUTHZUGGH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp)](https://app.codecov.io/gh/opensrp/fhircore/pull/3144?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) ```diff @@ Coverage Diff @@ ## main #3144 +/- ## ========================================= + Coverage 29.6% 30.1% +0.4% - Complexity 658 672 +14 ========================================= Files 239 239 Lines 11204 11231 +27 Branches 1948 1953 +5 ========================================= + Hits 3323 3384 +61 + Misses 7447 7406 -41 - Partials 434 441 +7 ``` | [Flag](https://app.codecov.io/gh/opensrp/fhircore/pull/3144/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | Coverage Δ | | |---|---|---| | [engine](https://app.codecov.io/gh/opensrp/fhircore/pull/3144/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | `67.0% <ø> (+0.7%)` | :arrow_up: | | [geowidget](https://app.codecov.io/gh/opensrp/fhircore/pull/3144/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | `47.2% <ø> (ø)` | | | [quest](https://app.codecov.io/gh/opensrp/fhircore/pull/3144/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp) | `5.7% <ø> (+0.2%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp#carryforward-flags-in-the-pull-request-comment) to find out more. [see 6 files with indirect coverage changes](https://app.codecov.io/gh/opensrp/fhircore/pull/3144/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensrp)
ellykits commented 3 months ago

Use the same naming convention for the test cases. See the documentation on OpenSRP docs

ellykits commented 3 months ago

@brandy-kay The tests should be re-written to verify and assert that related entity location meta tag is indeed added to the extracted resources from a questionnaire submission. To achieve this, the questionnaire needs to include a field that will be used to capture the location uuid. The link Id of this field is required to be configured in the Questionnaire Config. Refer to the code changes made in the PR 3097 referenced in the issue.

brandy-kay commented 3 months ago

@ellykits Have made some improvements on the test could you please have a look at it

brandy-kay commented 2 months ago

@ellykits have added assertion for the related entity resource meta tag