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

Add application navigation graph tests for AppMainActivity #2641

Merged
merged 7 commits into from
Oct 3, 2023

Conversation

LZRS
Copy link
Contributor

@LZRS LZRS commented Aug 3, 2023

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #[issue number] or Closes #[issue number]

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

@LZRS LZRS self-assigned this Aug 3, 2023
@LZRS LZRS changed the title Add RegisterFragment compose instrumentation tests Add RegisterFragment instrumentation tests Aug 3, 2023
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #2641 (d1a814c) into main (ad3a737) will increase coverage by 2.9%.
Report is 73 commits behind head on main.
The diff coverage is 63.4%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #2641     +/-   ##
=========================================
+ Coverage     64.5%   67.4%   +2.9%     
- Complexity    1075    1112     +37     
=========================================
  Files          218     223      +5     
  Lines         9635   10245    +610     
  Branches      1897    1876     -21     
=========================================
+ Hits          6218    6913    +695     
+ Misses        2234    2142     -92     
- Partials      1183    1190      +7     
Flag Coverage Δ
engine 71.7% <68.4%> (-1.0%) ⬇️
geowidget 65.5% <33.3%> (+1.1%) ⬆️
quest 64.5% <59.4%> (+5.6%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...rtregister/fhircore/engine/cql/LibraryEvaluator.kt 92.2% <100.0%> (+0.6%) ⬆️
...r/fhircore/engine/domain/model/RoundingStrategy.kt 100.0% <100.0%> (ø)
...gister/fhircore/engine/rulesengine/RulesFactory.kt 71.8% <100.0%> (+0.6%) ⬆️
...martregister/fhircore/engine/sync/AppSyncWorker.kt 100.0% <ø> (ø)
...ister/fhircore/engine/task/FhirTaskExpireWorker.kt 100.0% <100.0%> (ø)
...fhircore/engine/task/FhirTaskStatusUpdateWorker.kt 100.0% <100.0%> (ø)
...rcore/engine/util/extension/FhirEngineExtension.kt 80.0% <100.0%> (+2.8%) ⬆️
...hircore/engine/util/extension/ResourceExtension.kt 69.6% <100.0%> (-0.3%) ⬇️
...r/fhircore/geowidget/screens/GeoWidgetViewModel.kt 86.6% <100.0%> (+0.3%) ⬆️
...ircore/quest/data/register/RegisterPagingSource.kt 73.6% <100.0%> (+2.2%) ⬆️
... and 63 more

... and 34 files with indirect coverage changes

@pld pld marked this pull request as ready for review September 19, 2023 16:40
@LZRS LZRS marked this pull request as draft October 2, 2023 23:57
@LZRS LZRS marked this pull request as ready for review October 3, 2023 01:10
@LZRS LZRS requested a review from pld October 3, 2023 06:22
@LZRS LZRS changed the title Add RegisterFragment instrumentation tests Add application navigation graph tests for AppMainActivity Oct 3, 2023
Comment on lines +58 to +75
@get:Rule(order = 0)
val initWorkManager = TestRule { base, _ ->
WorkManagerTestInitHelper.initializeTestWorkManager(
ApplicationProvider.getApplicationContext(),
Configuration.Builder()
.setMinimumLoggingLevel(Log.DEBUG)
.setExecutor(SynchronousExecutor())
.build(),
)
return@TestRule base
}

@get:Rule(order = 1) val hiltRule = HiltAndroidRule(this)

@get:Rule(order = 2) val composeTestRule = createAndroidComposeRule<AppMainActivity>()

@BindValue
val configurationRegistry: ConfigurationRegistry = Faker.buildTestConfigurationRegistry()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! this part was always hard for me to figure out

@pld pld merged commit 5b059b3 into main Oct 3, 2023
6 checks passed
@pld pld deleted the tt-register-fragment-tests branch October 3, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants