mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-22 21:38:52 +00:00
- prepare-workflow-validation.ts: parse pnpm-workspace.yaml with the
`yaml` package instead of a regex; safer for any future formatting
drift in the catalog block.
- useWorkflowValidation: use the global `structuredClone` directly
instead of the in-tree `clone` helper. The helper falls back to
JSON parse/stringify in legacy environments, which is irrelevant
here (vitest happy-dom + production targets all support
`structuredClone`), and removing the import drops a transitive
dep on `@/scripts/utils` which made the composable harder to
unit-test.
- linkRepair.test.ts: drop the synthetic 'patched view diverges'
fixture (it didn't actually trigger the throw, exactly the
false-positive pythongosssss called out) and the duplicate
describeTopologyError-via-abort block (already covered in
linkTopology.test.ts). The abort path is now exercised structurally
in useWorkflowValidation.test.ts where a mocked
`LinkRepairAbortedError` flows through the catch.
- linkRepair.test.ts: keep the live-graph cast — the live-graph
branch in `repairLinks` genuinely accesses `graph.links` as a
record at runtime even though the published type is an array, so
the test fixture needs to mirror that mismatch.
- useWorkflowValidation.test.ts: use `createTestingPinia({
stubActions: false })`; replace the per-mock clears with
`vi.clearAllMocks()`; trim the vue-i18n mock down to identity
`t()` (matches what real i18n with empty messages would do); add
a JSON-snapshot test that proves the original graph is byte-equal
before and after an aborted repair (the prior `!== wf` assertion
only proved a different reference, not preservation).