Skip to content

chore: measure and start increasing jest tests coverage#3723

Merged
BRaimbault merged 5 commits into
masterfrom
chore/increase-jest-tests-coverage
Jul 17, 2026
Merged

chore: measure and start increasing jest tests coverage#3723
BRaimbault merged 5 commits into
masterfrom
chore/increase-jest-tests-coverage

Conversation

@BRaimbault

@BRaimbault BRaimbault commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Increases Jest coverage for the app's Redux logic (src/actions and src/reducers), which had almost no tests before this PR.

Tooling

  • Fixed collectCoverageFrom in jest.config.js (was src/**/*.js, silently excluding all .jsx component files from coverage reports)
  • Added coverage/ to .gitignore/.eslintignore/.prettierignore

Test 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 a TODO)

ui.js reducer 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/components in particular, is still untested).


ToDos

  • Follow-up: src/components (~400 files, largely untested) is the next biggest coverage gap N/A
  • Follow-up: add ui.js reducer coverage once the in-flight branch touching it lands N/A

Quality checklist

Add N/A to items that are not applicable.

  • Dashboard tested N/A
  • Cypress and/or Jest tests added/updated N/A
  • Docs added N/A
  • d2-ci dependencies replaced N/A
  • Tester approved (name) N/A

@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-3723.maps.netlify.dhis2.org

@dhis2-bot
dhis2-bot temporarily deployed to netlify July 16, 2026 08:16 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify July 16, 2026 09:49 Inactive
@BRaimbault
BRaimbault requested a review from edoardo July 16, 2026 09:56
@BRaimbault
BRaimbault marked this pull request as ready for review July 16, 2026 09:57
@BRaimbault BRaimbault changed the title chore: increase jest tests coverage chore: measure and start increasing jest tests coverage Jul 16, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 16, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@dhis2-bot
dhis2-bot temporarily deployed to netlify July 16, 2026 11:39 Inactive
@BRaimbault
BRaimbault merged commit f48b121 into master Jul 17, 2026
42 of 48 checks passed
@BRaimbault
BRaimbault deleted the chore/increase-jest-tests-coverage branch July 17, 2026 10:00
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