test(frontend): cover App root router (0% -> 100%)#64
Merged
Conversation
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
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.
Why
App.tsxwas 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:/login,/register,/setup,/confirm-email,/oauth/callbackeach render their page/→/loginProtectedRouteboth branches —/dashboard,/add-item,/settings,/recipesrender when authenticated; a protected route redirects to/loginwhen unauthenticatedinitializeThemeis called once on mountPages and
SetupGuardare stubbed (each has its own suite); the real auth store is driven viasetState; routes are selected viawindow.historysinceAppowns itsBrowserRouter.Result
App.tsx: 0% → 100% (lines/branches/funcs)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