mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 17:10:06 +00:00
Road to no explicit any part 8 group 5 (#8329)
## Summary - Add `createMockLLink` and `createMockLinks` factory functions to handle hybrid Map/Record types - Replace `as any` assertions with type-safe factory functions in minimap tests - Implement proper Pinia store mocking using `vi.hoisted()` pattern - Remove unused `createMockSubgraph` export (shadowed by local implementations) ## Test plan - [x] All minimap tests pass (29 tests) - [x] `pnpm typecheck` passes - [x] `pnpm lint` passes - [x] `pnpm knip` passes ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8329-Road-to-no-explicit-any-part-8-group-5-2f56d73d365081218882de81d5526220) by [Unito](https://www.unito.io) --------- Co-authored-by: AustinMroz <austin@comfy.org>
This commit is contained in:
committed by
GitHub
parent
440e25e232
commit
3946d7b5ff
@@ -20,18 +20,15 @@ export function useWorkflowValidation() {
|
||||
// Collect all logs in an array
|
||||
const logs: string[] = []
|
||||
// Then validate and fix links if schema validation passed
|
||||
const linkValidation = fixBadLinks(
|
||||
graphData as unknown as ISerialisedGraph,
|
||||
{
|
||||
fix: true,
|
||||
silent,
|
||||
logger: {
|
||||
log: (message: string) => {
|
||||
logs.push(message)
|
||||
}
|
||||
const linkValidation = fixBadLinks(graphData as ISerialisedGraph, {
|
||||
fix: true,
|
||||
silent,
|
||||
logger: {
|
||||
log: (...args: unknown[]) => {
|
||||
logs.push(args.join(' '))
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
if (!silent && logs.length > 0) {
|
||||
toastStore.add({
|
||||
@@ -52,7 +49,7 @@ export function useWorkflowValidation() {
|
||||
}
|
||||
}
|
||||
|
||||
return linkValidation.graph as unknown as ComfyWorkflowJSON
|
||||
return linkValidation.graph
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +77,9 @@ export function useWorkflowValidation() {
|
||||
|
||||
if (validatedGraphData) {
|
||||
try {
|
||||
validatedData = tryFixLinks(validatedGraphData, { silent })
|
||||
validatedData = tryFixLinks(validatedGraphData, {
|
||||
silent
|
||||
}) as ComfyWorkflowJSON
|
||||
} catch (err) {
|
||||
// Link fixer itself is throwing an error
|
||||
console.error(err)
|
||||
|
||||
Reference in New Issue
Block a user