test(frontend): extend unit test coverage for ResultPanelComponent#6556
Merged
Merged
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
*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:
|
Contributor
There was a problem hiding this comment.
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,displayResultbranches). - Added unit tests for geometry/interaction helpers (
resetPanelPosition,updateReturnPosition,onResize, drag handlers) and a preview-mode guard inrerenderResultPanel.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
Extends the existing
ResultPanelComponentspec (codecov ~57.5%) with 16 testscovering the previously-untested public methods. Existing services are the
real ones from the spec's
TestBed; specific methods arevi.spyOn-stubbed:openPanel(default dims + notifies resize service),closePanel(collapses),isPanelDocked(docked vs. undocked),clearResultPanel.displayConsole,displayError, anddisplayResultacross all three branches (paginated → table frame, non-paginated result →
visualization frame, no result → nothing).
resetPanelPosition,updateReturnPosition(delta +undefined no-op), and
onResize(therequestAnimationFramecallback is runsynchronously via a locally-restored spy so the assertion is deterministic).
handleStartDrag(hides the viz overlay) andhandleEndDrag(records the free-drag position).
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 wasverified by breaking an assertion to confirm the suite goes red):
(The component reads
localStorageon init; on Node 26 that needsNODE_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])