Skip to content

test(frontend): extend unit test coverage for ResultPanelComponent#6556

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
mengw15:chore/6549-result-panel-test
Jul 20, 2026
Merged

test(frontend): extend unit test coverage for ResultPanelComponent#6556
aglinxinyuan merged 1 commit into
apache:mainfrom
mengw15:chore/6549-result-panel-test

Conversation

@mengw15

@mengw15 mengw15 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends the existing ResultPanelComponent spec (codecov ~57.5%) with 16 tests
covering the previously-untested public methods. Existing services are the
real ones from the spec's TestBed; specific methods are vi.spyOn-stubbed:

  • visibilityopenPanel (default dims + notifies resize service),
    closePanel (collapses), isPanelDocked (docked vs. undocked),
    clearResultPanel.
  • content framesdisplayConsole, displayError, and displayResult
    across all three branches (paginated → table frame, non-paginated result →
    visualization frame, no result → nothing).
  • position & resizeresetPanelPosition, updateReturnPosition (delta +
    undefined no-op), and onResize (the requestAnimationFrame callback is run
    synchronously via a locally-restored spy so the assertion is deterministic).
  • draghandleStartDrag (hides the viz overlay) and handleEndDrag
    (records the free-drag position).
  • rerenderResultPanel — no-ops while previewing a workflow version.

All tests are deterministic (no real timers/network/random; the one rAF is
mocked synchronously and restored locally). No production code was changed.

Any related issues, documentation, discussions?

Closes #6549

How was this PR tested?

Extended unit tests, run locally in frontend/ (all green; the failure path was
verified by breaking an assertion to confirm the suite goes red):

ng test --watch=false --include src/app/workspace/component/result-panel/result-panel.component.spec.ts
# Tests  20 passed (20)   (4 existing + 16 new)
eslint <spec>       # clean
prettier --check    # clean

(The component reads localStorage on init; on Node 26 that needs
NODE_OPTIONS=--localstorage-file=... locally — CI on Node 24.10.0 provides it.)

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8 [1M context])

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 19, 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:

  • Contributors with relevant context: @kunwp1
    You can notify them by mentioning @kunwp1 in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.58%. Comparing base (80c45be) to head (4c9bed8).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6556      +/-   ##
============================================
+ Coverage     72.54%   72.58%   +0.03%     
  Complexity     3436     3436              
============================================
  Files          1145     1145              
  Lines         45129    45129              
  Branches       4975     4975              
============================================
+ Hits          32738    32756      +18     
+ Misses        10709    10685      -24     
- Partials       1682     1688       +6     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 80c45be
agent-service 76.76% <ø> (ø) Carriedforward from 80c45be
amber 66.81% <ø> (ø) Carriedforward from 80c45be
computing-unit-managing-service 17.72% <ø> (ø) Carriedforward from 80c45be
config-service 66.66% <ø> (ø) Carriedforward from 80c45be
file-service 66.80% <ø> (ø) Carriedforward from 80c45be
frontend 73.90% <ø> (+0.10%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 80c45be
pyamber 91.79% <ø> (ø) Carriedforward from 80c45be
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 80c45be

*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.

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

This PR extends the Angular unit test suite for ResultPanelComponent to improve coverage of the component’s public behaviors (visibility, frame selection, drag/resize handling), without changing production code.

Changes:

  • Added unit tests for panel visibility helpers (openPanel, closePanel, isPanelDocked, clearResultPanel).
  • Added unit tests for frame registration/selection (displayConsole, displayError, displayResult branches).
  • Added unit tests for geometry/interaction helpers (resetPanelPosition, updateReturnPosition, onResize, drag handlers) and a preview-mode guard in rerenderResultPanel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mengw15
mengw15 requested a review from aglinxinyuan July 19, 2026 08:22

@aglinxinyuan aglinxinyuan 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 20, 2026
Merged via the queue into apache:main with commit c009e9d Jul 20, 2026
23 checks passed
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 ResultPanelComponent

4 participants