The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
45b7b20e05864bca98def642e329d501e664413e / Eugene Gu <[email protected]>
test(frontend): add unit test coverage for ContextMenuComponent actions (#7148)

### What changes were proposed in this PR?

`ContextMenuComponent` backs the canvas right-click menu, but its
existing 13 tests only cover `canExecuteOperator` and its helpers; none
of the action methods was invoked by any test.

This PR extends `context-menu.component.spec.ts` with 16 tests covering
the remaining public surface:

- `onCopy` / `onPaste`: delegate to `OperatorMenuService`, each also
asserting the sibling method is not called.
- `onCut`: copy happens before delete (asserted via mock invocation
order).
- `onDelete` (mocked): all three deletion kinds are issued with the
snapshotted id lists inside exactly one `bundleActions` call; nothing is
deleted when the `bundleActions` callback is not run; the
`hasLinkWithID` guard skips links no longer in the graph; highlighted
ids are snapshotted before deletion mutates the live highlight arrays.
- `onDelete` (real `WorkflowActionService` on a seeded graph): deleting
an operator together with its attached highlighted link does not
double-delete the link (the real `deleteLinkWithID` throws on a missing
link); a standalone highlighted link is deleted while its endpoint
operators survive; highlighted comment boxes are deleted; the whole
mixed deletion is a single undo stack entry that one undo fully
restores.
- `hasHighlightedLinks`: false/true per link highlight state.
- `onClickExportHighlightedExecutionResult`: modal opens with
`ResultExportationComponent`, the workflow name, and the `context-menu`
source marker.
- Constructor subscriptions: `highlightedOperatorIds` /
`highlightedCommentBoxIds` follow the service stream emissions.

No production code is changed. The only shared-stub change is the
`OperatorMenuService` stub's two highlight streams becoming
`BehaviorSubject`s instead of `of([])` so the subscription tests can
push emissions; both emit `[]` on subscribe, so the pre-existing tests
are unaffected.

### Any related issues, documentation, discussions?

Closes #7147

### How was this PR tested?

This PR only adds tests. From `frontend/`, `npx ng test --watch=false
--include='**/context-menu.component.spec.ts'` passes 29/29 (13
pre-existing + 16 new); prettier and eslint are clean. With coverage
enabled, `context-menu.component.ts` reaches 100% statements, functions
and branches.

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

Co-authored by: Claude Code (Claude Fable 5)

Report URL: https://github.com/apache/texera/actions/runs/30603372212

With regards,
GitHub Actions via GitBox

Reply via email to