test(frontend): cover AgentPanelComponent#6384
Conversation
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
Pull request overview
Adds a comprehensive Vitest/TestBed unit test suite for AgentPanelComponent to significantly improve frontend coverage for the agent panel UI and its interaction logic (agent list wiring, activation/switching rules, deletion, geometry, and persisted settings).
Changes:
- Introduces
agent-panel.component.spec.tswith a broad set of behavioral and template render assertions (including workflow-mismatch guarding/warnings). - Uses lightweight stubs for child components (
texera-agent-registration,texera-agent-chat) to keep the panel template renderable while isolating tests to the panel. - Validates persistence and restoration of panel dimensions/docked state and container transform-derived return position via
localStorage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6384 +/- ##
============================================
+ Coverage 66.04% 66.56% +0.52%
Complexity 3380 3380
============================================
Files 1142 1142
Lines 44980 44980
Branches 4948 4948
============================================
+ Hits 29709 29943 +234
+ Misses 13631 13392 -239
- Partials 1640 1645 +5
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What changes were proposed in this PR?
Adds a Vitest/TestBed spec for
AgentPanelComponent(previously ~6% covered, no spec): agent-list init/refresh, activation flows with ngOnChanges guards, panel open/minimize, onAgentCreated branches, tab selection/switching incl. workflow-mismatch warning, canSwitchToAgent, deletion flows, resize/drag handling, and panel-settings load/save — with template render passes (tabs, count, lock icons, close buttons). Child components (registration/chat) are stubbed; each has its own spec.Any related issues, documentation, discussions?
Closes #6381.
How was this PR tested?
Added
agent-panel.component.spec.ts(42 tests) mirroring the agent-chat spec's subject-backed MockAgentService harness. Verified locally with Vitest and CI'sformat:cigate clean. Test-only change — no production code is modified.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])