Comfy-Org / Comfy-Org/ComfyUI_frontend
test: isolate legacy cross-layer unit fixtures
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
Isolate deliberately cross-layer legacy unit fixtures.
Keep architecture rules honest without losing regression coverage.
Full context for agent readers
## Problem/Goal
`src/platform/settings/composables/useLitegraphSettings.reactiveEdge.test.ts` deliberately imports the renderer-owned canvas store to reproduce a legacy synchronization edge. Because the fixture lives under `src/platform/**`, it needs an `import-x/no-restricted-paths` suppression even though the production layering rule is correct.
Create an explicit higher-level home for unit tests that must exercise legacy cross-layer behavior, analogous to `browser_tests/tests/legacyDoNotReplicate`, so exceptional fixtures do not weaken or locally suppress production-layer restrictions.
Origin: https://github.com/Comfy-Org/ComfyUI_frontend/pull/15980#discussion_r3868366096
## Proposed Solution
- Add a clearly named top-level unit-test fixture directory outside the production layer targets, using repository-consistent naming such as `legacyDoNotReplicate`.
- Move the reactive-edge regression fixture there without changing its behavior.
- Ensure Vitest, coverage, lint, and typecheck include the new location intentionally.
- Remove the fixture's `import-x/no-restricted-paths` suppression; do not relax the production layer zones.
## Acceptance Criteria
- The `CanvasInfo` explicit-source regression remains green at the fixed implementation and fails under the prior implicit `watchEffect` behavior.
- The lint detector and its existing semantic regression coverage remain unchanged and green.
- No production layer restriction is disabled, widened, or bypassed.
- The moved fixture requires no restricted-path suppression.
- The directory name and nearby documentation make clear that its cross-layer patterns are legacy-only and must not be copied into production code.
Contributor guide
Research direction
Start with src/platform/settings/composables/useLitegraphSettings.reactiveEdge.test.ts and trace how Vitest, coverage, lint, and typecheck discover unit-test fixtures. Move the regression fixture to a clearly named top-level legacy-only directory, preserve its behavior, and remove the restricted-path suppression. Done means the explicit-source regression and lint detector coverage stay green without weakening production layer rules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100