Skip to content

test(frontend): extend PropertyEditorComponent unit test coverage#6789

Merged
aglinxinyuan merged 5 commits into
apache:mainfrom
aglinxinyuan:test-fe-property-editor
Jul 22, 2026
Merged

test(frontend): extend PropertyEditorComponent unit test coverage#6789
aglinxinyuan merged 5 commits into
apache:mainfrom
aglinxinyuan:test-fe-property-editor

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends property-editor.component.spec.ts with 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, the beforeunload persistence, the constructor localStorage read/fallback, and the defensive if(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:ci passes.

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

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

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%.
Copilot AI review requested due to automatic review settings July 22, 2026 06:45
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 22, 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: @Yicong-Huang
    You can notify them by mentioning @Yicong-Huang in a comment.

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 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 PanelService close/reset streams.
  • Add unit tests for beforeunload + ngOnDestroy localStorage 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>
@aglinxinyuan
aglinxinyuan requested a review from mengw15 July 22, 2026 06:50
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-commenter

codecov-commenter commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.23%. Comparing base (a9f384e) to head (570cc90).
⚠️ Report is 5 commits behind head on main.

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     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from a9f384e
agent-service 76.76% <ø> (ø) Carriedforward from a9f384e
amber 67.17% <ø> (ø) Carriedforward from a9f384e
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from a9f384e
config-service 66.66% <ø> (ø) Carriedforward from a9f384e
file-service 67.21% <ø> (ø) Carriedforward from a9f384e
frontend 79.50% <ø> (+0.07%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from a9f384e
pyamber 92.15% <ø> (ø) Carriedforward from a9f384e
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from a9f384e

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

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

@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 22, 2026
Merged via the queue into apache:main with commit 055f7bb Jul 22, 2026
21 checks passed
@aglinxinyuan
aglinxinyuan deleted the test-fe-property-editor branch July 22, 2026 23: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.

Extend PropertyEditorComponent unit test coverage

4 participants