aglinxinyuan opened a new issue, #7589:
URL: https://github.com/apache/texera/issues/7589
### Task Summary
`frontend/src/app/workspace/component/workflow-editor/workflow-editor.component.ts`
sits at **79.9% of lines and 59.0% of branches**. The branch figure is the
real gap — a line counts as covered when only one side of its condition has
ever run, and here almost half the conditions have only gone one way.
The link-breakpoint block was covered by #7481, so what remains is
everything else: the magnet and connection validators, the read-only paper
lock, the recovering-state overrides, region reshape and recolour, blank-canvas
panning, window resize, the repaint streams, shift-multiselect over links and
comment boxes, port highlighting, the link hover tools, cursor presence, and
the agent hover labels.
None of it needs a browser, and that is worth stating because it looks like
it should. Both seams are already established in the existing spec:
- `(component.paper as any).trigger("<event>", view, evtObj, x, y)` with a
real `CellView` from `component.paper.findViewByModel(id)`. Note
`fromJointPaperEvent` only emits an argument **array** when several arguments
are passed, hence the trailing `0, 0`.
- Direct `.next()` on the services' subjects —
`WorkflowStatusService.statusSubject`,
`ExecuteWorkflowService.executionStateStream` / `regionUpdateStream` /
`regionStateStream`, the graph's `reuseOperatorChangedSubject` /
`operatorDisplayNameChangedSubject` / `portDisplayNameChangedSubject`,
`DragDropService.operatorSuggestionHighlight(Un)Stream`, and the agent subjects.
Four traps, each verified by probing:
1. **`paper.clientToLocalPoint` throws under jsdom**
(`this.cells.getScreenCTM is not a function`). It silently kills the
`handlePointerEvents` mousemove subscriber, because rxjs reports the error
asynchronously — the test just looks like it did nothing. Stub it; the wiring
is still asserted, only the projection arithmetic is faked.
`mouseleave`/`mouseenter` need no stub.
2. **`mockCommentBox.commentBoxID` is `"1"`, the same as
`mockScanPredicate.operatorID`.** Any comment-box-versus-operator test must use
a distinct id or its assertions are meaningless.
3. **The `throw` on an unknown transition out of recovering fires inside a
subscriber**, so rxjs reports it asynchronously and `expect(...).toThrow()`
does not catch it.
4. **jsdom `MouseEvent` has no `movementX`** — define it on the event for
the pan test. The window-resize test needs `fakeAsync` plus `tick(50)` for the
`auditTime(30)`, and `tick(200)` to drain `invokeResize`'s 175 ms timeout.
Two branches are **dead rather than untested**: the false arm at line 726
and its counterpart at 1116. The stream is pre-filtered to `hasOperator ||
hasCommentBox`, so inside the non-shift `else` a false `hasOperator` implies
`hasCommentBox`. They should not be tested; they are why branch coverage stops
short of 100%.
### 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]