Skip to content

test(frontend): cover AgentPanelComponent#6384

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:test-fe-agent-panel
Jul 13, 2026
Merged

test(frontend): cover AgentPanelComponent#6384
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:test-fe-agent-panel

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

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's format:ci gate 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])

Copilot AI review requested due to automatic review settings July 12, 2026 23:57
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.ts with 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-commenter

codecov-commenter commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.56%. Comparing base (afa8af2) to head (28e2b8a).
⚠️ Report is 6 commits behind head on main.

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     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from afa8af2
agent-service 51.90% <ø> (ø) Carriedforward from afa8af2
amber 66.57% <ø> (ø) Carriedforward from afa8af2
computing-unit-managing-service 9.97% <ø> (ø) Carriedforward from afa8af2
config-service 52.30% <ø> (ø) Carriedforward from afa8af2
file-service 63.97% <ø> (ø) Carriedforward from afa8af2
frontend 64.72% <ø> (+1.21%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from afa8af2
pyamber 91.18% <ø> (ø) Carriedforward from afa8af2
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from afa8af2

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan aglinxinyuan requested a review from mengw15 July 13, 2026 00:39

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@aglinxinyuan aglinxinyuan added this pull request to the merge queue Jul 13, 2026
Merged via the queue into apache:main with commit e40c0bd Jul 13, 2026
23 checks passed
@aglinxinyuan aglinxinyuan deleted the test-fe-agent-panel branch July 13, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit test coverage for AgentPanelComponent

4 participants