Comfy-Org / Comfy-Org/ComfyUI_frontend
test: the box-drawing path is unreachable from unit tests, so five mutants survive
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
`getNodeBoxes` lives inside `GraphCanvas.vue` and is therefore unreachable from unit tests. Every defect in the box-drawing path survives mutation as a result, including one that shipped.
## Mutants that survive across 7,966 tests
- Remove the `NODE_TITLE_HEIGHT` adjustment from the box bounds entirely.
- Remove `applyLightThemeColor` from the box colour path.
- Fall the box fill back to the node body token.
- Un-gate the slot hit-test while suspended.
- Un-gate the widget hit-test while suspended.
The first of these is not hypothetical: a double-application of the title-bar offset shipped in #15031 and no test noticed. The last two remove the guard that is the entire point of the "make the simplified mode safe to interact with" work.
## Suggested shape
Extract `getNodeBoxes` as a pure function of `(entries, colors, viewport, titleHeight)` in a module beside `nodeBoxRenderer.ts`. That makes geometry and colour assertable directly, and would have caught the offset bug before it was written.
Separately, no e2e screenshots the box overlay at all, which is why nothing caught it at the integration level either. A single `@screenshot` spec that zooms below the threshold would cover the whole visual surface.
## Affected area
- `src/components/graph/GraphCanvas.vue`
- `src/lib/litegraph/src/LGraphCanvas.ts` (the suspension guards)
- `browser_tests/tests/vueNodes/`
Found by mutation testing during review of #15031.
Contributor guide
Assessment
This issue has not been assessed yet.