Skip to content

test(frontend): cover App root router (0% -> 100%)#64

Merged
untraceablez merged 1 commit into
mainfrom
test/frontend-app-coverage
Jun 25, 2026
Merged

test(frontend): cover App root router (0% -> 100%)#64
untraceablez merged 1 commit into
mainfrom
test/frontend-app-coverage

Conversation

@untraceablez

Copy link
Copy Markdown
Owner

Why

App.tsx was the single largest coverage gap in the project — 81 lines at 0% (the root router/layout was never tested). Closing it is the biggest single move toward the remaining ~269 uncovered lines.

What

Adds App.test.tsx (test-only; no source change) covering the whole component:

  • Public routes/login, /register, /setup, /confirm-email, /oauth/callback each render their page
  • Index redirect//login
  • ProtectedRoute both branches/dashboard, /add-item, /settings, /recipes render when authenticated; a protected route redirects to /login when unauthenticated
  • Theme initinitializeTheme is called once on mount

Pages and SetupGuard are stubbed (each has its own suite); the real auth store is driven via setState; routes are selected via window.history since App owns its BrowserRouter.

Result

  • App.tsx: 0% → 100% (lines/branches/funcs)
  • Full frontend suite: 449 passed (43 files)

This is part 1 of closing the remaining coverage gaps (overall 97.8% → heading to ~99.5%); a backend-infra coverage PR (db/, core/cache, core/deps, main.py) follows.

🤖 Generated with Claude Code

App.tsx was the single largest coverage gap (81 lines, 0%). Adds
App.test.tsx exercising the whole route table + the ProtectedRoute
guard + the theme-init effect:
- each public route (/login, /register, /setup, /confirm-email,
  /oauth/callback) renders its page
- the index route "/" redirects to /login
- protected routes (/dashboard, /add-item, /settings, /recipes) render
  when authenticated (ProtectedRoute pass-through branch)
- a protected route redirects to /login when unauthenticated
  (ProtectedRoute Navigate branch)
- initializeTheme is called once on mount

Pages + SetupGuard are stubbed (each has its own suite); the real auth
store is driven via setState; routes are selected via window.history
since App owns its BrowserRouter. App.tsx -> 100% lines/branches/funcs.
Full frontend suite: 449 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wr2keVNHj51gFeShnKqa7Q
@untraceablez untraceablez merged commit 9f29b18 into main Jun 25, 2026
1 check passed
@untraceablez untraceablez deleted the test/frontend-app-coverage branch June 25, 2026 19:54
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