Skip to content

test(frontend): boost SPA coverage for utils, hooks, and small UI - #217

Merged
mariusmm merged 5 commits into
mainfrom
feature/frontend-coverage-boost
Aug 3, 2026
Merged

test(frontend): boost SPA coverage for utils, hooks, and small UI#217
mariusmm merged 5 commits into
mainfrom
feature/frontend-coverage-boost

Conversation

@mariusmm

@mariusmm mariusmm commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Vitest coverage for high-ROI pure modules (tableUtils, statusAuthorDefaults, transport, statusGlyph)
  • Extend hook tests (useFormSubmit, useResizableGraphHeight load/persist/drag)
  • Cover small components (StatusBadge, Pagination, ResizableGraphShell)
  • Cover light pages (HomeRedirect, NoProjectsHome, HelpPage) with mocked dashboard/outlet

Coverage result (local)

Before After
Lines 5.7% (768 / 13,489) 9.3% (1,258 / 13,489)
Branches 77.5% 81.7%
Functions 23.2% 34.9%
Tests 74 125

Notable module rates now:

  • utils / lib100%
  • hooks49% (was ~18%)
  • components/table79%
  • components/graph48%
  • transport.ts100%

Large pages (MatrixPage, ReportsPage, catalog/groups) remain deferred.

Test plan

  • cd frontend && npm test (125 tests green)
  • CI frontend-tests posts updated module coverage comment
  • No frontend coverage gate (still under 10%)

Made with Cursor

marius added 5 commits August 3, 2026 22:48
Add unit tests for tableUtils, statusAuthorDefaults, fetchJson error paths,
and statusGlyph so high-ROI modules are no longer at 0% coverage.
Exercise localStorage load/persist for graph height and the shared
useFormSubmit success/error paths used by auth forms.
Add component tests for status chip styling, table pagination controls,
and the resizable graph shell chrome.
Mock dashboard/outlet context to assert loading, empty-project, navigation,
and help section rendering without mounting the full app shell.
Assert style presence without relying on happy-dom hsl normalization.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Frontend Code Coverage

Frontend SPA coverage (by module)

Module Line Rate Branch Rate Function Rate Health
api 7.2% (65 / 903) 80.0% 4.2%
components 10.3% (274 / 2668) 84.9% 53.8%
components/graph 48.1% (50 / 104) 100.0% 33.3%
components/reports 0.0% (0 / 20) 100.0% 100.0%
components/table 79.2% (38 / 48) 100.0% 100.0%
context 39.7% (48 / 121) 55.0% 50.0%
hooks 49.2% (98 / 199) 78.1% 81.8%
lib 100.0% (57 / 57) 100.0% 100.0%
pages 7.5% (510 / 6792) 77.4% 55.6%
pages/catalog 0.0% (0 / 1473) 12.5% 12.5%
pages/groups 0.0% (0 / 870) 0.0% 0.0%
src (root) 9.4% (12 / 128) 92.9% 66.7%
types 100.0% (0 / 0) 100.0% 100.0%
utils 100.0% (106 / 106) 98.2% 100.0%
Summary 9.3% (1258 / 13489) 81.7% 34.9%

Generated from Vitest @vitest/coverage-v8 (frontend/src).

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
marreq-core.src.importers 5% 0
marreq-cloud.src.api 78% 0
marreq-core.src.routes 48% 0
marreq-core.src.fairings 89% 0
marreq-core.src 67% 0
marreq-core.src.generators 0% 0
marreq-core.src.helper_functions 93% 0
marreq-cloud.src.services 91% 0
marreq-core.src.deployment 83% 0
marreq-core.src.repository.cache 100% 0
marreq-core.src.reqif 83% 0
marreq-core.src.services 90% 0
marreq-core.src.auth.guards 46% 0
marreq-core.src.models 81% 0
marreq-core.src.diff 100% 0
marreq-cloud.src 72% 0
marreq-core.src.api 77% 0
marreq-core.src.auth.rate_limiter 94% 0
marreq-core.src.services.semantic_search 75% 0
marreq-core.src.validation 96% 0
marreq-server.src 62% 0
marreq-cloud.src.fairings 100% 0
marreq-core.src.repository 43% 0
marreq-core.src.auth 91% 0
Summary 75% (22695 / 30307) 0

@mariusmm
mariusmm merged commit e7a356c into main Aug 3, 2026
5 checks passed
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.

1 participant