Skip to content

test: enforce global 90% coverage and expand app hook tests - #219

Merged
robinebers merged 6 commits into
mainfrom
chore/bump-test-coverage
Feb 25, 2026
Merged

test: enforce global 90% coverage and expand app hook tests#219
robinebers merged 6 commits into
mainfrom
chore/bump-test-coverage

Conversation

@robinebers

@robinebers robinebers commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Description

  • Adds focused tests for app hooks/components that were under-covered (use-panel, settings action hooks, probe refresh actions, bootstrap, and AppContent).
  • Expands settings tests to cover legacy tray migration fallback and global shortcut load/save branches.
  • Enforces global coverage thresholds at 90% for statements, branches, functions, and lines in vite.config.ts.

Related Issue

  • None linked.

Type of Change

  • Bug fix
  • New feature
  • New provider plugin
  • Documentation
  • Performance improvement
  • Other (describe below)

Other: test-suite and quality-gate improvements (coverage + thresholds).

Testing

  • I ran bun run build and it succeeded
  • I ran bun run test and all tests pass
  • I tested the change locally with bun tauri dev
  • I ran bun run test:coverage and coverage meets enforced thresholds

Screenshots

  • Not applicable (no visual/UI behavior changes).

Checklist

  • I read CONTRIBUTING.md
  • My PR targets the main branch
  • I did not introduce new dependencies without justification

Made 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: AppContent view routing and retry callback wiring, usePanel tray 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). Expands settings tests to cover legacy tray key migration edge cases (single key present and store implementations without delete) 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.

  • Refactors
    • Switch Vitest coverage to global thresholds (90% for statements/branches/functions/lines; per-file disabled) in vite.config.ts.

Written for commit 9e4b537. Summary will update on new commits.

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>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

@davidarny davidarny left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 settings tests 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) and AppContent routing/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.

@validatedev validatedev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks alright!

@robinebers
robinebers merged commit e58837b into main Feb 25, 2026
3 checks passed
@robinebers
robinebers deleted the chore/bump-test-coverage branch February 25, 2026 11:07
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.

4 participants