mengw15 opened a new issue, #7332:
URL: https://github.com/apache/texera/issues/7332

   ### 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
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to