Skip to content

feature: increase project coverage#43

Merged
Nacchofer31 merged 10 commits intomasterfrom
feature/increase-coverage
Mar 22, 2026
Merged

feature: increase project coverage#43
Nacchofer31 merged 10 commits intomasterfrom
feature/increase-coverage

Conversation

@Nacchofer31
Copy link
Copy Markdown
Owner

Increase test coverage and exclude non-coverable files from JaCoCo

What was done

New unit tests (commonTest):

  • ResultDataTest — extension functions map, onSuccess, onError, asEmptyDataResult
  • RandomFilmMappersTestFilmDto.toFilm() including edge case with empty releaseYear
  • DataErrorTest — all Remote and Local enum entries
  • RandomBoxdEndpointsTest — all endpoint URL builder functions
  • DefaultDispatchersTestio and default dispatcher properties
  • RandomFilmViewModelTest — extended with OnUserNameChanged, OnInfoButtonClick, OnAddOrRemoveUserNameSearchList, OnFilmSearchModeToggle, OnUserNameAdded,
    OnRemoveUserName, OnFilmClicked, and multi-user submit
  • RandomFilmScrappingRepositoryTest — extended with HTTP error paths (500 responses), fallback image URL when poster fetch fails, and no-script-tag edge case
  • RandomFilmMappersTest — mapper field mapping correctness

New instrumented tests (androidInstrumentedTest):

  • RandomFilmScreenTest — added tests for error state rendering (FilmErrorView) and UnionIntersectionSwitch visibility

JaCoCo exclusions (fileFilter):

  • Android platform-specific files (AndroidPlatform, MainActivity, Platform, OnboardingPreferences, ComposableSingletons$MainActivityKt)
  • Room-generated code (UsernameDatabase_Impl, UserNameDao_Impl, UserNameDatabaseConstructor)
  • Kotlin inline functions, which JaCoCo cannot track at declaration site (ResultData, RandomBoxdHttpClientExtKt)
  • Pure interfaces with no executable code (RandomFilmRepository)
  • Compose UI theme (RandomBoxdTheme)
  • kotlinx.coroutines compiler-generated lambda classes ($$inlined$items*, $special$$inlined*)

…omFilmViewModel`, and `RandomFilmScreen`

- **Repository**: Added tests for HTTP error handling (server errors) and fallback logic when poster page requests or script parsing fails.
- **ViewModel**: Added tests for username changes, clearing states on info click, managing the search list, toggling film search modes (UNION/INTERSECTION), and handling multi-user submissions.
- **UI (Android)**: Added instrumented tests to verify error view visibility for remote errors and visibility of the submit button during multi-user searches.
…omFilmViewModel`, and `RandomFilmScreen`

- **Repository**: Added tests for HTTP error handling (server errors) and fallback logic when poster page requests or script parsing fails.
- **ViewModel**: Added tests for username changes, clearing states on info click, managing the search list, toggling film search modes (UNION/INTERSECTION), and handling multi-user submissions.
- **UI (Android)**: Added instrumented tests to verify error view visibility for remote errors and visibility of the submit button during multi-user searches.
@Nacchofer31 Nacchofer31 merged commit 915dffe into master Mar 22, 2026
5 checks passed
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Nacchofer31 Nacchofer31 deleted the feature/increase-coverage branch March 22, 2026 15:53
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.

2 participants