test(frontend): extend PropertyEditorComponent unit test coverage#6789
Conversation
Add 16 tests covering the port-editing reaction and operator->port switch, the port+link and not-syncing guard branches, the currentlyEditing awareness clear, resize/open/close/reset, the PanelService streams, beforeunload persistence, the constructor localStorage read/fallback, and the defensive false-path guards. Coverage 79% -> 100%.
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
Pull request overview
This PR expands the Angular unit test coverage for PropertyEditorComponent by adding a broad set of new specs that exercise port-highlighting behavior, panel open/close/reset actions, panel service streams, and localStorage persistence paths.
Changes:
- Add unit tests for operator→port frame switching and port/link highlight guard branches.
- Add unit tests for resize/open/close/reset handlers and
PanelServiceclose/reset streams. - Add unit tests for
beforeunload+ngOnDestroylocalStorage persistence and constructor localStorage read/fallback paths.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
Empty commit to spawn a fresh workflow run; the prior run's build/frontend jobs kept hitting an infra flake (a different OS failing early each rerun, fail-fast cancelling the rest). The full local suite (3413 tests) and format:ci are green.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6789 +/- ##
============================================
+ Coverage 75.20% 75.23% +0.03%
Complexity 3446 3446
============================================
Files 1160 1160
Lines 45807 45807
Branches 5071 5071
============================================
+ Hits 34449 34464 +15
+ Misses 9746 9732 -14
+ Partials 1612 1611 -1
*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:
|
…spec The afterEach block was indented at column 0 instead of column 2 (nested in the describe); prettier-eslint (the CI lint gate, applying eslint indent rules) flagged it though standalone prettier did not. Re-indent to satisfy format:ci.
A prior automated review-fix commit had rewritten the afterEach to await fixture.whenStable(), but the rendered child frames keep the zone perpetually unstable, so the await hung teardown and left TestBed un-reset (surfacing as 'test module already instantiated' on later specs) and was mis-indented (failing the prettier-eslint lint gate). Restore a synchronous teardown, keeping the localStorage cleanup, correctly indented inside the describe.
What changes were proposed in this PR?
Extends
property-editor.component.spec.tswith 16 tests (4 -> 20), covering the port-editing reaction and operator->port frame switch, the port+link and not-syncing guard branches, the currentlyEditing awareness clear, the resize/open/close/reset handlers, the PanelService streams, thebeforeunloadpersistence, the constructor localStorage read/fallback, and the defensiveif(contentEl)/if(rightContainer)false paths. Coverage 79% -> 100%. No existing tests modified.Any related issues, documentation, discussions?
Closes #6787.
How was this PR tested?
ng test --include='**/property-editor.component.spec.ts'-> 20/20 passing.yarn format:cipasses.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])