Skip to content

extend ContextMenuComponent template coverage #7332

Description

@mengw15

Task Summary

ContextMenuComponent's template is at ~54% (context-menu.component.html, 33 uncovered lines) while its class file is already at 100% — every handler is unit-tested, but the template's menu items are never clicked, so the (click) bindings that wire them up stay uncovered. Bring the template to full coverage. Vitest/jsdom; see frontend/TESTING.md.

Behavior to add

Extend context-menu.component.spec.ts to exercise the menu through the DOM, then run the coverage report and cover the remaining red lines. The gap is entirely (click) handler bindings — e.g. onCopy(), onCut(), onPaste(), and the operator-menu actions such as operatorMenuService.disableHighlightedOperators().

Approach:

  • Render the menu (fixture.detectChanges()), query each menu item with fixture.debugElement.query(By.css("...")) and fire .triggerEventHandler("click", null).
  • Assert the click reaches the expected collaborator — spy the component method or the injected OperatorMenuService / WorkflowActionService double (vi.fn()), and check it was called.
  • Where an item is conditionally shown, set the state that renders it first so the item exists to click.

Since the class is already fully covered, the point here is the wiring: each menu entry invokes the handler it declares. Do not assert on layout/geometry under jsdom.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions