You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(frontend): extend unit test coverage for ResultPanelComponent (#6556)
### 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:
- **visibility** — `openPanel` (default dims + notifies resize service),
`closePanel` (collapses), `isPanelDocked` (docked vs. undocked),
`clearResultPanel`.
- **content frames** — `displayConsole`, `displayError`, and
`displayResult`
across all three branches (paginated → table frame, non-paginated result
→
visualization frame, no result → nothing).
- **position & resize** — `resetPanelPosition`, `updateReturnPosition`
(delta +
undefined no-op), and `onResize` (the `requestAnimationFrame` callback
is run
synchronously via a locally-restored spy so the assertion is
deterministic).
- **drag** — `handleStartDrag` (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])
0 commit comments