Repository navigation
Description
Task Summary
workflow-editor.component.ts is the second-largest frontend coverage gap (147 missed lines), and
about a third of it is one contiguous block that no test has ever entered: handleLinkBreakpoint()
and the four handlers it installs (handleLinkBreakpointToolAttachment,
handleLinkBreakpointButtonClick, handleLinkBreakpointHighlightEvents,
handleLinkBreakpointToggleEvents, lines 1311–1417).
The reason is the guard at line 202, which has two halves and both default to false in a test:
if (this.config.env.linkBreakpointEnabled && this.workflowActionService.getHighlightingEnabled()) {
this.handleLinkBreakpoint();
}MockGuiConfigServicesetslinkBreakpointEnabled: false, whilegui.confships
link-breakpoint-enabled = true;WorkflowActionService.highlightingEnabledis a private field initialised tofalseand turned on
when a workflow is loaded.
So this is a shipped feature with zero coverage, not dead code. Both flags have to be set before
the first detectChanges() — ngAfterViewInit reads them once, when it decides whether to install
the handlers at all — after which the whole block is reachable in jsdom with no extra infrastructure.
Notes for whoever writes this:
- JointJS
LinkView.hideTools()delegates toToolsView.hide()→focusTool(null), which hides the
individual tools; it does not setdisplayon theToolsViewelement. Assert on
view._toolsView.tools[0].isVisible(), not on the tools element's style. - The breakpoint show/hide subjects are
jointLinkBreakpointShowStream/jointLinkBreakpointHideStream
(the public accessors drop thejointprefix). - Trap. Asserting multi-select state after a plain breakpoint click proves nothing:
WorkflowActionService.highlightLinks(multiSelect, …)sets multi-select itself
(workflow-action.service.ts:502), so the handler's ownsetMultiSelectModeat line 1346 can be
deleted and the assertion still passes.unhighlightLinksdoes not touch it, so the shift-click
unhighlight branch is where the handler is the only writer.
Task Type
- Refactor / Cleanup
- DevOps / Deployment / CI
- Testing / QA
- Documentation
- Performance
- Other
Activity
test(frontend): cover the link-breakpoint handlers in the workflow ed…