test: enforce global 90% coverage and expand app hook tests - #219
Merged
Conversation
Add focused hook/component coverage tests and expand settings coverage for migration/shortcut branches. Switch Vitest coverage enforcement to global 90% across statements, branches, functions, and lines. Co-authored-by: Cursor <cursoragent@cursor.com>
davidarny
approved these changes
Feb 24, 2026
There was a problem hiding this comment.
Pull request overview
This PR strengthens the frontend test suite by adding targeted unit tests for core app hooks/components and by enforcing stricter global Vitest coverage thresholds (90%) to keep overall coverage from regressing.
Changes:
- Enforce global 90% coverage thresholds (statements/branches/functions/lines) in Vitest config.
- Expand
settingstests to cover legacy tray migration edge cases and global shortcut load/save branches. - Add new test suites for key app hooks (
usePanel, settings action hooks, probe refresh actions, settings bootstrap) andAppContentrouting/callback wiring.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
vite.config.ts |
Switches coverage enforcement to global thresholds at 90% across metrics. |
src/lib/settings.test.ts |
Adds coverage for legacy tray migration fallbacks and global shortcut load/save validation. |
src/hooks/app/use-settings-system-actions.test.ts |
Tests persistence side effects, analytics events, and error logging for system settings actions. |
src/hooks/app/use-settings-plugin-actions.test.ts |
Tests plugin reorder/toggle flows, probe-start behavior, and persistence error handling. |
src/hooks/app/use-settings-display-actions.test.ts |
Tests display/theme/reset-timer actions, tray update scheduling, and persistence failure logging. |
src/hooks/app/use-settings-bootstrap.test.ts |
Tests bootstrap fallback behavior and autostart apply logic. |
src/hooks/app/use-probe-refresh-actions.test.ts |
Tests manual refresh eligibility/cooldown filtering and failure cleanup paths. |
src/hooks/app/use-panel.test.ts |
Tests listener registration behavior and unlisten cleanup on early unmounts. |
src/components/app/app-content.test.tsx |
Tests view routing (home/settings/detail) and retry callback wiring. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
use-panel, settings action hooks, probe refresh actions, bootstrap, andAppContent).settingstests to cover legacy tray migration fallback and global shortcut load/save branches.vite.config.ts.Related Issue
Type of Change
Other: test-suite and quality-gate improvements (coverage + thresholds).
Testing
bun run buildand it succeededbun run testand all tests passbun tauri devbun run test:coverageand coverage meets enforced thresholdsScreenshots
Checklist
mainbranchMade with Cursor
Note
Low Risk
Test-only changes plus stricter coverage gates; primary risk is CI failures or increased maintenance due to tighter thresholds, with no runtime behavior changes.
Overview
Raises the quality gate for the repo’s test suite by switching Vitest coverage to global thresholds and increasing minimum coverage to 90% (branches/lines/functions/statements), disabling per-file enforcement.
Adds new unit tests covering previously under-tested app surfaces:
AppContentview routing and retry callback wiring,usePaneltray listener behavior and unmount cleanup, probe refresh actions (eligibility filtering, analytics, and failure cleanup), and settings hooks for display/plugin/system actions and bootstrap paths (including persistence failures). Expandssettingstests to cover legacy tray key migration edge cases (single key present and store implementations withoutdelete) plus global shortcut load/save validation.Written by Cursor Bugbot for commit 9e4b537. This will update automatically on new commits. Configure here.
Summary by cubic
Enforces global 90% coverage and adds tests for AppContent routing and core app hooks. Coverage now includes tray settings migration edge cases (delete missing), global shortcut load/save + Tauri update, auto-refresh scheduling/next-at, probe refresh eligibility/errors, panel listener setup/cleanup, display/plugin/system settings persistence/errors, and start-on-login autostart apply.
Written for commit 9e4b537. Summary will update on new commits.