Skip to content

test: lift frontend coverage to 80%+ and enforce threshold - #216

Open
Uday9909 wants to merge 2 commits into
c2siorg:mainfrom
Uday9909:feat/coverage-80
Open

test: lift frontend coverage to 80%+ and enforce threshold#216
Uday9909 wants to merge 2 commits into
c2siorg:mainfrom
Uday9909:feat/coverage-80

Conversation

@Uday9909

Copy link
Copy Markdown
Contributor

Summary

Raises the webapp's vitest coverage from 59.7% → 95.9% statements and wires an enforced 80% coverage threshold into vite.config.js so CI fails on regression.

Changes

  • Hooks (useSession, useStreamingOutput): full lifecycle tests (create/end/error/expiry/streaming, 1000-line cap, unmount cleanup).
  • Pages: Login (render + navigate), Demo (mock mode, live mode, 503/429/404/409 errors, reset, getMockResponse branches).
  • Debug panels (Functions, Stack, Breakpoint, BreakPoints, MemoryMap, Threads): loading / error / no-session / fetch-success / fetch-error states.
  • api.js: request interceptor (session_id injection) + response interceptor (404 → session-expiry callback) via a capture adapter.
  • src/setupTests.js: stub Element.prototype.scrollIntoView (jsdom doesn't implement it; Demo's log panel calls it in an effect).
  • vite.config.js: add coverage.thresholds (statements/branches/lines 80, functions 75) so the existing CI coverage step gates on the target.

Results

  • 115 tests passing (was 57)
  • Statements 95.85% · Branch 91.6% · Lines 95.85% · Functions 77%
  • ESLint: 0 errors · vite build: green

Test plan

  • npx vitest run --coverage — 115 pass, thresholds enforced
  • npx eslint src/ — 0 errors
  • npm run build — green

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