Skip to content

feat(ai-harness): add branch-coverage tests for ai-harness-view.tsx - #573

Merged
d-oit merged 1 commit into
mainfrom
feat/ai-harness-view-branch-coverage
Jul 31, 2026
Merged

feat(ai-harness): add branch-coverage tests for ai-harness-view.tsx#573
d-oit merged 1 commit into
mainfrom
feat/ai-harness-view-branch-coverage

Conversation

@d-oit

@d-oit d-oit commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Branch Coverage: ai-harness-view.tsx (38.88% -> ~65% branches)

What

12 targeted tests covering key branches in the ai-harness-view.tsx component.

Coverage Areas

Area Tests
Input guards empty input not sent
API key handling missing-key error toast
Message streaming successful stream send, chunk display
Error handling throw adds error message, abort handled silently
Rate limiting rate-limited assistant message
Web research URL fetch when enabled
Settings auto-save after load
Ollama models refresh fetch, empty fallback to defaults

Notes

  • Uses vi.hoisted() for all mock factories (fixes Vitest TDZ on hoisted vi.mock references)
  • Mocks: framer-motion, lucide-react, sonner, cn, ai-settings, use-reduced-motion, @/lib/ai, @/lib/ai/types, @/lib/ai/research, ai-harness-settings, shared-primitives, store

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
do-knowledge-studio Ready Ready Preview, v0 Jul 31, 2026 8:54am

@github-actions github-actions Bot added config tests Related to automated/manual tests labels Jul 31, 2026
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@d-oit
d-oit merged commit e887465 into main Jul 31, 2026
23 checks passed
@d-oit
d-oit deleted the feat/ai-harness-view-branch-coverage branch July 31, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config tests Related to automated/manual tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant