chore: measure and start increasing jest tests coverage#3723
Merged
Conversation
Contributor
|
🚀 Deployed on https://pr-3723.maps.netlify.dhis2.org |
BRaimbault
marked this pull request as ready for review
July 16, 2026 09:57
|
edoardo
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Increases Jest coverage for the app's Redux logic (
src/actionsandsrc/reducers), which had almost no tests before this PR.Tooling
collectCoverageFrominjest.config.js(wassrc/**/*.js, silently excluding all.jsxcomponent files from coverage reports)coverage/to.gitignore/.eslintignore/.prettierignoreTest coverage
src/actions: 0 → 100% coverage across all 15 modules (pure action creators, no side effects)src/reducers: added coverage for 11 previously-untested reducers (aggregations,analyticalObject,contextMenu,dataTable,download,feature,featureProfile,interpretation,layerSources,orgUnitProfile) — all now at 100%src/reducers/layerEdit.js(634 lines, ~68 branches — the biggest gap, holds most of the layer-editing state logic): 3% → 100%src/reducers/map.js(333 lines, ~20 branches plus two internal sub-reducers): 13% → 99% (one remaining gap is dead code, marked with aTODO)ui.jsreducer is intentionally left out — another branch has in-flight changes to it.Overall repo coverage moved from ~37% to ~42% statements (most of the codebase,
src/componentsin particular, is still untested).ToDos
src/components(~400 files, largely untested) is the next biggest coverage gap N/Aui.jsreducer coverage once the in-flight branch touching it lands N/AQuality checklist
Add N/A to items that are not applicable.