test: improve frontend coverage 26% → 70%#81
Conversation
Add 11 new test files and expand 3 existing ones covering: - Store slices: model, settings, generation, history gaps - Lib: api, diagnostics, window-shell, app-shortcuts, prompt-examples gaps - Components: PlaybackBar, Toast, bootstrap banners, GenerationPanel sub-components, settings screens, layout components 801 tests, all passing. Coverage jumps from 26.04% to 69.73% lines.
Greptile SummaryThis PR adds 11 new test files and expands 3 existing ones to improve frontend line coverage from ~26% to ~70%, plus a one-line CI fix that downgrades
Confidence Score: 5/5All changes are additive test code and a one-line CI action version fix; no production logic is modified. Every changed file is either a new or expanded test file, or the CI workflow where the only edit corrects a wrong major-version tag on the Codecov test-results upload step. No store slices, components, or API wrappers were modified. The test assertions were verified against the actual source implementations and are accurate throughout. The CI workflow change (codecov/test-results-action version) is worth a quick sanity-check that Codecov CI actually passes after merge, as that checkbox was left unchecked in the PR description. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph StoreSlices["Store Slices (unit tested)"]
MS[model-slice.test.ts]
SS[settings-slice.test.ts]
GS[store-slices.test.ts]
end
subgraph Utilities["Utilities (unit tested)"]
API[api.test.ts]
WS[window-shell.test.ts]
DX[diagnostics.test.ts]
AS[app-shortcuts.test.ts]
end
subgraph Components["UI Components (unit tested)"]
PB[playback-bar.test.tsx]
BB[bootstrap-banners.test.tsx]
GP[generation-panel-subcomponents.test.tsx]
LC[layout-components.test.tsx]
SC[settings-components.test.tsx]
TT[toast.test.tsx]
end
CI[.github/workflows/ci.yml]
StoreSlices --> Components
Utilities --> StoreSlices
CI -.->|uploads JUnit results| StoreSlices
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
subgraph StoreSlices["Store Slices (unit tested)"]
MS[model-slice.test.ts]
SS[settings-slice.test.ts]
GS[store-slices.test.ts]
end
subgraph Utilities["Utilities (unit tested)"]
API[api.test.ts]
WS[window-shell.test.ts]
DX[diagnostics.test.ts]
AS[app-shortcuts.test.ts]
end
subgraph Components["UI Components (unit tested)"]
PB[playback-bar.test.tsx]
BB[bootstrap-banners.test.tsx]
GP[generation-panel-subcomponents.test.tsx]
LC[layout-components.test.tsx]
SC[settings-components.test.tsx]
TT[toast.test.tsx]
end
CI[.github/workflows/ci.yml]
StoreSlices --> Components
Utilities --> StoreSlices
CI -.->|uploads JUnit results| StoreSlices
Reviews (6): Last reviewed commit: "fix: stub setPointerCapture for jsdom in..." | Re-trigger Greptile |
- Fix taskType "text-to-audio" → "text2music" in playback-bar test - Derive TOTAL_EXAMPLES from PROMPT_CATEGORIES.length instead of hardcoding - Fix codecov/test-results-action version v5 → v1 (v5 doesn't exist)
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
- Add missing vitest imports (settings-slice, toast) - Remove unused imports (layout-components, window-shell) - Fix GenerationFormValues mock to include all required fields - Fix mock type casts (store mock, DeviceInfo null) - Fix TimeSignature "4/4" → "4", play() return type - Fix CSSProperties custom property access - Fix spread argument types in mock factories
Summary
Improve frontend test coverage from 26.04% to 69.73% lines (499 → 1348 covered lines). 801 tests, all passing.
New test files (11)
model-slice.test.tssettings-slice.test.tsapi.test.tsdiagnostics.test.tswindow-shell.test.tsplayback-bar.test.tsxtoast.test.tsxbootstrap-banners.test.tsxgeneration-panel-subcomponents.test.tsxsettings-components.test.tsxlayout-components.test.tsxExpanded test files (3)
store-slices.test.ts— generation and history slice gap coverageapp-shortcuts.test.ts— uncovered branchesprompt-examples.test.ts— uncovered code pathsTest plan
pnpm vitest run)pnpm vitest run --coverage)