Skip to content

test(frontend): cover WorkflowEditorComponent connection validation, clipboard, and delete paths#6829

Open
mengw15 wants to merge 3 commits into
apache:mainfrom
mengw15:chore/6827-workflow-editor-test
Open

test(frontend): cover WorkflowEditorComponent connection validation, clipboard, and delete paths#6829
mengw15 wants to merge 3 commits into
apache:mainfrom
mengw15:chore/6827-workflow-editor-test

Conversation

@mengw15

@mengw15 mengw15 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends the existing WorkflowEditorComponent spec with the file's non-rendering
slice — connection validation, the clipboard handlers, and the delete /
select-all paths the keyboard tests never reach. The paper-event and pointer
handlers stay out of scope (they need real dia.Paper geometry / browser mode).

12 new tests take the component from 68.6% to 74.0% statement coverage (+31
lines) and bring every targeted method to 100%:

  • validateJointOperatorConnection — rejects a link drawn out of an input port
    and one dropped onto an output port; delegates an output→input pair to the
    operator-level check (proved by re-running once the link exists).
  • validateOperatorConnection guards — self-connection, a missing port on
    either end, and an endpoint that is not an operator.
  • deleteElements — highlighted links and comment boxes are deleted, not just
    operators.
  • handleElementSelectAll — ⌘/Ctrl+A also highlights links and comment boxes.
  • handleElementCopy / handleElementCut / handleElementPaste — copy caches
    the selection, cut caches then deletes it, paste delegates to the operator menu.
  • handleDisableOperator — repaints the operator on disable and on re-enable.

No production code was changed.

Any related issues, documentation, discussions?

Closes #6827.

How was this PR tested?

ng test --watch=false --include src/app/workspace/component/workflow-editor/workflow-editor.component.spec.ts
— 57 passed (45 existing + 12 new), run 3× for determinism. The failure path was
verified by breaking an assertion (red, non-zero exit), and eslint/prettier are
clean. Coverage was measured with --coverage before and after to confirm each
targeted method reached 100%.

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 23, 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: @PG1204
    You can notify them by mentioning @PG1204 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

Extends the Angular unit test suite for WorkflowEditorComponent to cover previously untested non-rendering behaviors (logic that does not require real JointJS dia.Paper geometry / browser-mode), aligning with the scope in Issue #6827.

Changes:

  • Adds unit tests for connection validation (validateJointOperatorConnection and validateOperatorConnection guard cases).
  • Adds unit tests for keyboard-driven delete/select-all paths to ensure links and comment boxes are included, not only operators.
  • Adds unit tests for clipboard handlers (copy/cut/paste) and for repaint behavior when operators are disabled/re-enabled.

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

@codecov-commenter

codecov-commenter commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.50%. Comparing base (3149eb5) to head (1177f5f).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6829      +/-   ##
============================================
+ Coverage     76.44%   76.50%   +0.06%     
+ Complexity     3456     3450       -6     
============================================
  Files          1161     1161              
  Lines         45922    45919       -3     
  Branches       5101     5100       -1     
============================================
+ Hits          35105    35131      +26     
+ Misses         9269     9241      -28     
+ Partials       1548     1547       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 01e173c
agent-service 76.76% <ø> (ø) Carriedforward from 01e173c
amber 67.31% <ø> (-0.02%) ⬇️ Carriedforward from 01e173c
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 01e173c
config-service 66.66% <ø> (ø) Carriedforward from 01e173c
file-service 67.21% <ø> (ø) Carriedforward from 01e173c
frontend 82.24% <ø> (+0.15%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 01e173c
pyamber 92.15% <ø> (ø) Carriedforward from 01e173c
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 01e173c

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

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 WorkflowEditorComponent non-rendering logic

3 participants